Skip to content

docs(unstable): clarify subagent message views, unknown state, and session references - #2801

Merged
benbrandt merged 1 commit into
mainfrom
docs/subagents-clarifications
Nov 12, 2026
Merged

benbrandt merged 1 commit into
mainfrom
docs/subagents-clarifications

Conversation

@benbrandt

Copy link
Copy Markdown
Member

Clarifies points in the Subagent Sessions RFD that came up while bringing the Claude Agent and Codex adapters in line with it. None of these change the wire format. The feature stays behind unstable_subagents.

RFD

  • Sender not known. An incoming view omits senderSessionId when the Agent has no evidence of the sender. The Agent must not assume the parent.
  • Linking views. An Agent links two views only when it can establish they are the same message, and leaves them unlinked otherwise.
  • Outgoing view timing. An Agent may report it when the send starts or completes, and should not report one for a send it knows failed.
  • unknown state. It also applies when the Agent itself stops tracking a child that may still be working. The child's unfinished tool calls, terminals, and v2 background list stay as last reported. The Agent must not invent final statuses, and the Client must not present them as confirmed live or as failed.
  • Capabilities with unknown. The Agent can revoke them in the same subagent_update.
  • Session references. They are resent when a tool call's content is replaced, and added only for sessions the Agent can resolve.

Draft guides and schema descriptions

  • The session-directed messages sections of the v1 prompt-turn and v2 prompt-lifecycle draft pages cover the sender-less incoming view and the linking rule.
  • The v1 and v2 draft tool-calls pages cover resending session references and resolving handles.
  • The UnknownStateUpdate description in v1 and v2 said "Capabilities are updated separately". It now matches the RFD and mentions unfinished tool calls and terminals. The unstable schemas and draft schema pages are regenerated.

Stable pages are unchanged.

Related

@benbrandt
benbrandt requested a review from a team as a code owner November 12, 2026 14:59
@benbrandt
benbrandt added this pull request to stack #2802 November 12, 2026 15:33
@benbrandt
benbrandt merged commit c392d7e into main Nov 12, 2026
14 checks passed
@benbrandt
benbrandt deleted the docs/subagents-clarifications branch November 12, 2026 15:34
@acp-release-bot acp-release-bot Bot mentioned this pull request Nov 12, 2026
benbrandt added a commit to agentclientprotocol/claude-agent-acp that referenced this pull request Nov 12, 2026
…ence children from tool calls (#1608)

Brings the RFD form of subagent reporting in line with the ACP [Subagent
Sessions RFD](https://agentclientprotocol.com/rfds/subagents), which is
moving to Preview in agentclientprotocol/agent-client-protocol#2800. The
related RFD clarifications merged in
agentclientprotocol/agent-client-protocol#2801. AIR output is unchanged,
and no scenario snapshots changed.

## Changes

- **`unknown` at a conversation reset.** A child that is still working
at `conversation_reset` now reports `unknown` and `capabilities: null`,
not `idle`. The adapter forgets its children at reset, so it can no
longer observe or stop them. v1 reports it on the parent's
`subagent_update`. v2 also sends `state_update` `unknown` on the child.
- Stream end, stream error, `queryEnded`/`retire`, and `worker_restart`
keep `idle`, because the work is known to have stopped.
- In v2, the forgotten child's unfinished tool calls keep their last
status. They are no longer forced to `failed`.
- **`session` tool call content.** Added live and in replay, for the v1
RFD form and v2, only when the child is already announced:
  - `TaskStop` whose `task_id` is a child's agent id.
  - `SendMessage` that stays visible and targets a child's agent id.
- v1 only: an Agent/Task launch that a permission request keeps visible.
- The reference is repeated on every update that carries content,
because `content` replaces the whole array.
- **Docs.** The README's subagent section matches the code: SendMessage
is hidden and reported as linked messages, `unknown` at reset, `session`
content, and no `session_message_chunk`. Three stale comments are fixed.

## Workarounds and limits

- **Post-response ordering still uses `setTimeout(0)`.** SDK 2.6.0 gives
`onRequest` handlers no responder or after-response hook. The comments
in `src/v2/agent.ts` and `src/v1/acp-agent.ts` now state what the
ordering relies on: the response is queued in the microtask after the
handler returns, and `Connection.sendMessage` is first-in, first-out.
The SDK does not promise this.
- **The `unknown` change assumes Claude Code keeps subagents running
across `/clear`.** That comes from the existing v2 comment and test
double. It was not checked against the real CLI.
- No reference is added when a tool names a child by agent name, or for
v2 launch calls that a permission request shows.
- A child that is idle at reset keeps its `cancel` capability. Unchanged
here.
- A stream error with a client-supplied `spawnClaudeCodeProcess` still
reports `idle`, although closing may not stop a remote CLI.

## Testing

- `npm run build`: clean.
- `npm run check`: clean.
- `npm run test:run`: 73 files passed, 5 skipped. 4117 tests passed, 33
skipped.
- Integration tests against the real CLI were not run.
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