Skip to content

chatd: let a chat message its parent and siblings in the family #247

Closed

Description

@ibetitsmike

Xum created this issue on behalf of @ibetitsmike.

Part of moving the pstack lead ("Pstack General", Xum workspace 8ac7791132) to a Coder Agents chat on this fork.

Gap

A chat can message only its direct children (message_agent, coderd/x/chatd/subagent.go:74). A child reaches its parent only by ending its turn, and it cannot reach a sibling at all.

The lead's whole operating model in Xum is messages between long-lived peers. Counts from the Xum transcripts, 2026-11-08 to 2026-11-12:

Workspace task_send_message calls Peer messages received
Lead 1236 2444
Fork ops 1599 2602
W6 plugin packs 366 (278 to ops, 73 to the lead)

Two flows have no Coder Agents equivalent today:

  • A workstream reports READY, a slot request or a blocker to the lead and keeps working. In Coder Agents it must end its turn, and wait_for_events reports only "done".
  • A workstream talks to ops directly for a validation slot or a UAT run (278 sends from W6 alone). As siblings under one lead they cannot, so the lead would relay every message.

Wanted

  • A tool for any chat in a family to send a message to its parent, a sibling or another family member by chat ID.
  • The message wakes an idle recipient and queues for a busy one, the same way message_agent treats a busy child.
  • The recipient sees who sent it (chat ID and title), marked as an agent message and not as the user.
  • The conversation shows the call as a card, and the recipient's chat shows the message with its sender.
  • Rate limits per chat, like notify_user has.

Acceptance

  • Child A sends to sibling B while B is idle, and B runs a turn with the message and A's ID.
  • A child sends to its parent mid-turn and continues, and the idle parent wakes.
  • A chat outside the family is refused.

Activity

  1. added
    enhancement
    pstack-parity
    on Nov 12, 2026
  2. ibetitsmike commented on Nov 12, 2026

    @ibetitsmike
    OwnerAuthor

    Xum posted this comment on behalf of @ibetitsmike.

    Tracked in #255.

  3. ibetitsmike commented on Nov 13, 2026

    @ibetitsmike
    OwnerAuthor

    Xum posted this comment on behalf of @ibetitsmike.

    W14 status: PR 1 of 4 is open as #265 (message_family_chat behind fork-family-messages, head 24c507b). Next: PR 2 list_family_chats while #265 is in review, then the site tool card and recipient header after #265 merges.

  4. ibetitsmike commented on Nov 13, 2026

    @ibetitsmike
    OwnerAuthor

    Xum posted this comment on behalf of @ibetitsmike.

    #265 is ready to merge at d4a21e5: fork-ci green, clean Codex review, dev-build UAT passed for all three acceptance items.

  5. ibetitsmike commented on Nov 13, 2026

    @ibetitsmike
    OwnerAuthor

    Xum commented on behalf of @ibetitsmike.

    Status: #265 (message_family_chat) is READY at d589b93.

    • chatd.chat_family_messages now has organization_id (NOT NULL, references organizations, ON DELETE CASCADE), copied from the sender chat. The rate-limit index is (sender_chat_id, organization_id, created_at).
    • fork-ci 9/9 green (run 43415145608), Codex clean on the head, 0 unresolved threads.
    • UAT round 2 passed 5/5 on ac48997: sibling message, a child waking its idle parent, refusal outside the family, the 60 per hour limit, and the tool hidden with the experiment off. Every recorded row had the sender chat's organization. The head then merged main; the only difference from the tested diff is the generated Experiment enum list.

    Next: #266 (list_family_chats) gets #265 merged in and goes through the same checks.

  6. ibetitsmike commented on Nov 13, 2026

    @ibetitsmike
    OwnerAuthor

    Xum commented on behalf of @ibetitsmike.

    Status: #266 (list_family_chats) is READY at 9ef2d69346c3cdbbafa45b4b96e36ed69e881dd4.

    • fork-ci run 43422627245 passed 9/9 on this head.
    • Codex is clean on 9ef2d69346 (comment), with 0 unresolved threads.
    • Remote UAT round 3 passed on this head:
      • family relations match the DB tree;
      • a list then a message to a grandchild works;
      • archived chats leave the list;
      • an archived family refuses new messages;
      • both tools disappear with the experiment off.
    • The branch carries main 044995538c (docs(coderd/x/chatd): describe fork features in ARCHITECTURE.md #272). Its ARCHITECTURE.md diff is one bullet describing list_family_chats.
  7. ibetitsmike commented on Nov 13, 2026

    @ibetitsmike
    OwnerAuthor

    Xum commented on behalf of @ibetitsmike.

    W14 status: opened #273 (PR 3 of 4, the tool cards for message_family_chat and list_family_chats) at f3d06bb.

  8. ibetitsmike commented on Nov 13, 2026

    @ibetitsmike
    OwnerAuthor

    Xum commented on behalf of @ibetitsmike.

    W14 status: opened #274 (PR 4 of 4, which shows a delivered family message with its sender in the recipient chat) at 1ac8de0.

  9. ibetitsmike commented on Nov 13, 2026

    @ibetitsmike
    OwnerAuthor

    Xum commented on behalf of @ibetitsmike.

    W14 status: READY sent to the lead for #273 (c110e0a, fork-ci 43441690194, Codex OK) and #274 (719c59e, fork-ci 43442696693, Codex OK). The UI UAT on :3100 is pending and will be run by ops.

  10. ibetitsmike commented on Nov 13, 2026

    @ibetitsmike
    OwnerAuthor

    Xum commented on behalf of @ibetitsmike.

    #273 merged as b98d50d. #274 now merges main at 4118393 (merge commit, no force-push). The only conflict was the add/add in site/src/testHelpers/forkFamilyMessages.ts, resolved by keeping both PRs' exports. UAT passed on both exact heads (c110e0a and 719c59e). fork-ci and Codex are pending on the new head.

  11. ibetitsmike commented on Nov 13, 2026

    @ibetitsmike
    OwnerAuthor

    Xum commented on behalf of @ibetitsmike.

    READY #274 4118393 (merge of main b98d50d into 719c59e, tree 243f89d8eb). fork-ci run 43448037472 succeeded (9/9 checks). Codex OK receipt 6856778724 on this head, 0 unresolved threads. UAT passed on 719c59e (fork ops verdict sha1 bb9409e4f1). Apart from the helper merge, the diff against 719c59e matches the #273 squash.

  12. ibetitsmike commented on Nov 13, 2026

    @ibetitsmike
    OwnerAuthor

    Xum commented on behalf of @ibetitsmike.

    All four PRs for this issue are merged into main behind the fork-family-messages experiment:

    PR What Merge SHA
    #265 message_family_chat tool: a chat can message its parent and siblings 5ff45d4
    #266 list_family_chats tool: a chat can list its family 30a2533
    #273 Tool cards for both tools in the Agents UI b98d50d
    #274 A delivered family message shows "Message from agent" and a link to the sender chat 2bf9127

    Mike's fork server autodeployed fork-main-2bf9127b59 (all four PRs) at 2026-11-13 16:38 local, and it passed the health check (v2.39.1-devel+2bf9127b59).

    Known limits and possible follow-ups, not done here:

    Closing as done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpstack-parity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions