docs: add multi-chat sessions proposal#184
Conversation
Draft design proposal for representing multiple chats within a single AHP session: a session becomes a thin container of shared context plus a catalog of chats, with a new ahp-chat: channel holding per-chat turns. Captures the resolved design questions (chat URI shape, catalog on the session summary, session-level aggregates, removal of session-level turns/activeTurn, chat/session config inheritance, session-level activeClient, intra-session chat forks, chat-targeted fetchTurns/ completions, and the SemVer version story) along with validation against Claude Agent Teams and the alternatives considered. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Thanks for this proposal, this is an interesting design space. I'm curious if you think we 'stop' at a a single level of nesting or if we go deeper. Like why could I not have a meta-lead session that delegates to other lead sessions that delegate to multiple chats? That would influence the design quite a bit.
I wonder if this actually needs to be the case? Team-based operations all have a lead chat. Even for forking, you will have an original chat you start with. If we do go more towards the direction of infinitely nestable chats, then having a 'root' node of the chat tree would simplify the model. cc @TylerLeonhardt both for the Claude POV and his experience with George 😛 |
|
Really like the depth question — it pushed me to think about whether multi-chat alone is the right abstraction or whether nesting belongs in the same model. After working through it I landed on a two-primitive composition I'd like to sketch, then explain why I want to land them as two PRs rather than one. The shape I'd propose for depth. Add a
The two compose: a "meta-lead" is just a session whose children are sessions, each of which may have chats and further sub-sessions. Subagent / agent-team / dynamic-workflow style topologies all fall out — we're not modeling features, we're providing the two primitives whose combinations cover them. On your "tree needs a root" point — I agree, and I think this resolves it: the session itself is the structural root of the tree. That lets us keep "chats are equal peers within a session" (no special primary-chat in state) and have a real root that owns aggregation and lifecycle. Both concerns met without contradiction. But I'd like to land multi-chat first and sub-sessions as a separate proposal. Not because depth isn't important — because the two changes have very different shapes:
Bundling them risks burying both. Sequencing is also cheaper pre-1.0 — smaller increments, fewer flying chunks of compatibility per release. The chat catalog and Happy to spin the sub-session proposal next if the direction sketched above resonates — or to discuss the shape further here before I do. What do you think? |
…ions Updates the multi-chat proposal in response to PR #184 review feedback: - Add a Scope section clarifying that this proposal covers multi-chat (breadth) only; arbitrary nesting via sub-sessions (depth) is deferred to a separate proposal but designed to compose orthogonally. - Add an 'Open implementation questions' subsection enumerating concerns that survive scoping to chat-only: cross-chat write coordination, disposal lifecycle, interactive routing under concurrency, aggregation bounds, session-wide turn history, default-chat UI hint, and forward compatibility with sub-sessions. - Add a closing paragraph to the alternatives section sketching the two-primitive (chats = breadth, sub-sessions = depth) composition that a future proposal will introduce. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
I did some research and discussion with my agent. Specifically in thinking about multi-chats, I want to get to a place where we can model big multi-agent systems native in AHP. Obviously we don't need to one-shot Gas Town into this initial proposal, but we should create a foundation for that. With that perspective our findings were:
So tl;dr I think your initial proposal is pretty good 😄 However I would not put this stuff on the SessionSummary unless you need it as part of the session list prior to subscribing to a session. I'm actually going to break SessionSummary out of the SessionState as part of #187 gpt did some nice research here and ended up concluding with generally the same model that I had in my head https://chatgpt.com/share/6a2190f5-c3c0-83ea-adb9-38f32747d022 |
Incorporates connor4312's review (#184 (comment)) and the supporting multi-agent-systems research note: - Reframe motivation: session = coordination scope, chats = conversation streams over that scope (the AHP-as-DAP/LSP framing). Make explicit that the protocol does not model agent hierarchies; those are host concerns. - Move chats[] catalog from SessionSummary to SessionState. Keeps the session-list view cheap and aligns with issue #187 (splitting SessionSummary out of SessionState) so the dual-update problem is not re-created. Subscribing to the session delivers the full catalog. - Add Q11: defaultChat?: URI on SessionState — a UI input-routing hint for unaddressed messages. Explicitly framed as routing, not hierarchy; chats remain equal peers at the protocol level. - Add Q12: replace fork-specific forkedFrom with a ChatOrigin discriminated union (userCreated / forked / createdByOperation). Populate userCreated and forked now; createdByOperation reserved for future coordination-primitives work — declaring the union shape now avoids a breaking change when operations land. - Rewrite §12 forward-direction: drop sub-sessions / parentSession as the next axis. Replace with coordination primitives (work items, operations, assignments) as the natural follow-up — matches the DAP/LSP philosophy and what real multi-agent systems coordinate around in practice. - Drop the resolved 'UI default chat hint' and 'forward-compat with sub-sessions' items from open implementation questions (now covered by Q11 and §12 respectively). - Update §8 surface, §7 compat notes, and breaking-change table for the catalog move and the new fields. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Thanks for the deep dive — really helpful, and the framing from your research note shifted the proposal in a few important ways. Just pushed Adopted from your comment + research note:
Not adopted (and why):
Assuming we're aligned on the above, I'll start on the implementation (types in |
- Replace 'createdByOperation' variant with 'tool' to avoid name overlap
with ChangesetOperation* (which uses 'operation' for an unrelated
concept). Tool-spawned chats are the realistic near-term path anyway.
- Rename variants per AHP style: 'userCreated' → 'user', 'forked' → 'fork'.
- Use a const enum ChatOriginKind as the discriminator (matches existing
AHP convention, e.g. PendingMessageKind, TerminalClaimKind).
- Tool variant carries { chat: URI, toolCallId: string } so it references
the tool call that spawned it; Fork variant carries { chat, turnId }
for the branched-from point.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
Adds a draft design proposal (
docs/proposals/multi-chat-sessions.md) for representing multiple chats within a single AHP session. This is a discussion document, not a protocol change — notypes/or generated code is touched.The idea
Today an AHP session is exactly one linear chat (
SessionState.turns+ a singleactiveTurn). The proposal promotes the session to a thin container of shared context + a catalog of chats, introducing a newahp-chat:channel that holds the per-chat conversation state a session has today:This enables: shared context, branching/forking, concurrent turns, UI grouping, and task decomposition.
Resolved design decisions captured
ahp-chat:/<cid>SessionSummary.chats(mirrorschangesets); nolistChats, no "primary chat" — chats are equal peersstatus/activity/modifiedAt) derived across chatsturns/activeTurn(turns live only on the chat channel)model/agent/config overrides, inheriting from the sessionactiveClientstays session-level / sharedfetchTurns/completionstarget the chat channel0.3.0→0.4.0), with an explicit rebuttal of the "capabilities first" convention (the change is removal-shaped + pre-1.0)Also included
Notes for reviewers
AGENTS.mdno CHANGELOG entry is required.docs/proposals/and not wired into the VitePress sidebar — it's a working design doc, not published spec.