Repository navigation
feat: sessions start and message each other - #239
Merged
Merged
Conversation
- StartSession (fresh, fork, fork in a new worktree), always user-approved; SendMessage to session:<id> across projects with message and report modes; ListSessions; RenameSession for the agent's own session. - The server stamps the origin of every session message from the SDK connection; envelopes escape forged tags and sanitize display titles. - Reports to an idle parent are queued in its transcript and delivered with its next turn; a working parent gets them at once. - User messages sent during a turn wait for the next turn (CLI priority later), can be withdrawn or sent now, and survive a restart at turn end. - Messages that reach a session mid-turn are persisted and shown in history. - Sidebar nests spawned and forked sessions; session messages render as collapsible rows; pending reports and queued messages bars. - Remove the inherited UDS/bridge peer messaging stubs. - Reorganize docs into docs/general and docs/features/<feature>; add the session-links tech design.
…e duplicates - Queue, withdraw, send-now, restart hold/resend and report queue/claim/delivery now live in services/turnQueueService.ts; the ws handler only calls it. - Reuse errorMessage, escapeXmlAttr, openSessionTab, Button link variant and one localStorage string-list pair; share the bar frame and the parent kind type. - Keep the sidebar sort order for child sessions; show origin.summary as is. - Do not rename the session or clear finished tasks for a queued message. - Drop the unused pid-file bridge id and its helpers. - Tests: inherited mode and model, queue and report error paths, batch merge, relative time; docs updated for the queue bar and session state fields.
This was referenced Nov 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Sessions can now start other sessions and talk to each other, and the sidebar shows which session came from which.
StartSession: start a child session,freshwith a brief or as aforkof the current conversation, optionally in a new git worktree. Always asks the user, whatever the permission mode (asafetyCheckask that bypass and auto mode cannot skip). Subagents cannot use it.SendMessagetosession:<id>, across projects.mode: "message"wakes the receiver;mode: "report"is a progress update to the caller's parent: delivered at once if the parent is mid-turn, otherwise queued in the parent's transcript and delivered with its next turn.summaryis optional for sessions (first line of the body).ListSessions, andRenameSessionfor the agent's own session. A session has one display name, its title.<cross-session-message>(forged tags escaped, titles sanitized) with a note that it carries no user authority and that text replies do not reach the sender.later) instead of being slipped into the running turn. They are listed above the composer and can be withdrawn or sent now (interrupts the turn); Stop does the same while something is queued. Queued messages are held and resent when a model or permission change restarts the CLI at turn end.queued_commandattachments were dropped from transcripts by the upstreamisLoggableMessagefilter, so messages that reached a session mid-turn vanished on reload and on resume. They are now written and shown in history; fork and rewind resolve them by their client id.ListPeers,/peers,udsMessaging,peerSessions, …).services/turnQueueService.ts; the ws handler only calls it.docs/generalanddocs/features/<feature>; addeddocs/features/session-links/tech-design.md(Chinese). The outdated glossary was removed.Related to #162.
Why
Agent teams need sessions that can delegate to and coordinate with other full sessions. The CLI had only stubs for this (
UDS_INBOXbehind a disabled flag), and session messages must be distinguishable from human messages, which text tags cannot guarantee.How it was tested
bun test: 2461 pass, 0 fail.bun test --randomizeover the touched files: 224 pass; after the review fixes, the queue, session-links and batching test files again: 119 pass. The new server test files were also run 6 at a time in parallel (72 runs) with no failures after fixing shared ids between tests.bun run lintclean,bun run test -- --run2678 pass.Not covered by hand: a real CLI restart at turn end with queued messages (covered by a unit test through the no-restart path), and light/dark screenshots.