Skip to content

Refactor Threads, add Chat service, add delivery open question#17

Open
emerson-gray wants to merge 2 commits into
mainfrom
threads-chat-delivery
Open

Refactor Threads, add Chat service, add delivery open question#17
emerson-gray wants to merge 2 commits into
mainfrom
threads-chat-delivery

Conversation

@emerson-gray

Copy link
Copy Markdown
Collaborator

Threads refactored

  • Participant-type-agnostic — removed type enum from Participant. Threads identifies participants by ID only, same behavior for all.
  • AckMessages — explicit acknowledgment method, separate from GetMessages. Handles crash recovery: messages remain unacknowledged until consumer confirms processing.
  • Removed read_status from Message model (acknowledgment tracked separately).
  • Business logic (chat UX, agent processing, channel integration) lives in services built on top of Threads.

Chat service (new — architecture/chat.md)

Built-in web/mobile app chat experience on top of Threads:

  • Thread lifecycle (create, add participants, archive)
  • Unread counts based on Threads acknowledgment state
  • Message delivery from UI via Gateway → Chat → Threads

Channels updated

  • Channels create and manage their own threads per integration logic
  • Own apps (web, mobile) are not channels — served by Chat service
  • Outbound flow uses pull + AckMessages

Open questions updated

  • Added: Message Delivery Unification — three patterns (notifications fire-and-forget, agent pull, channel push) need alignment. Options: message broker vs. notifications + pull fallback.
  • Removed: Filesystem store migration (resolved — Teams uses PostgreSQL).
  • Trimmed: Threads Data Store — removed resolved sub-questions (orchestrator interaction, read-status ownership).

Other updates

  • system-overview.md — Chat added to diagram and component table; Gateway routes to Chat instead of Threads directly
  • control-data-plane.md — Chat added as data plane service
  • media.md — removed read_status from Message model
  • README.md — Chat added to index

Threads:
- Participant-type-agnostic (removed type enum from Participant)
- Added AckMessages method (explicit acknowledgment, separate
  from reading, handles crash recovery)
- Removed read_status from Message model
- Business logic lives in services on top of Threads

Chat service (new):
- Built-in web/mobile app chat experience on top of Threads
- Thread lifecycle, unread counts, message delivery for own UI

Channels:
- Channels create and manage their own threads
- Own apps (web, mobile) are not channels — served by Chat
- Outbound flow uses AckMessages

Open questions:
- Added Message Delivery Unification (broker vs notifications+pull)
- Removed filesystem store migration (resolved)
- Removed resolved sub-questions from Threads Data Store

Updated: system-overview, control-data-plane, media, README
- Restored ack_status field on Message in threads.md and media.md
  (AckMessages writes it, ack_status is how consumers read it)
- Replaced Chat responsibilities table with proper Interface
  (CreateChat, GetChats, GetMessages, SendMessage, MarkAsRead)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant