Skip to content

feat: report delegated tasks as session messages and reference children from tool calls - #760

Merged
benbrandt merged 1 commit into
mainfrom
feat/subagents-rfd-conformance
Nov 12, 2026
Merged

benbrandt merged 1 commit into
mainfrom
feat/subagents-rfd-conformance

Conversation

@benbrandt

Copy link
Copy Markdown
Member

Brings the standard subagent contract in line with the ACP Subagent Sessions RFD, which is moving to Preview in agentclientprotocol/agent-client-protocol#2800. The AIR legacy contract is unchanged, and its fixtures are untouched.

Changes

  • Delegated tasks are session_message views, live and on replay, for v1 and v2.
    • A userMessage item in a child's thread becomes the incoming view on the child. It was dropped before, and counted as a history gap on replay.
    • A completed spawnAgent, sendInput, sendMessage, or followupTask with a prompt becomes the outgoing view on the sender. Failed or interrupted calls report nothing.
    • The two views are linked with senderMessageId and recipientMessageId when the same text is seen for the same recipient on both sides.
  • description no longer holds the task prompt. It is the thread's agentRole, and is omitted when Codex reports none.
  • Collaboration tool calls carry session content for each already-announced receiver. spawnAgent stays hidden, because the announcement and the task message report the delegation.
  • No Agent-side capability for standard Clients. sessionCapabilities.subagents is sent only to AIR, whose contract documents it. The RFD defines no Agent-side capability.
  • SDK ~2.6.0, which types session content. It also adds configOptions to v2 session/new and session/resume. The adapter does not advertise initial config options, so it does not apply them.
  • Docs. docs/subagent-sessions.md now describes the standard contract, the AIR legacy contract, and the fallback separately. The README, readme-dev.md, and docs/air-extensions.md are corrected.

Workarounds and limits

  • Linking by text. Codex exposes no ID shared by the sender's collab item and the receiver's userMessage item, so views are matched by recipient and equal text. If Codex rewrites the prompt on delivery, the views stay unlinked.
  • Sender-less incoming views. userMessage items have no sender field, so an unlinked incoming view carries only recipientSessionId. The adapter does not assume the parent, since another session can also send input.
  • description is the raw role token, for example default.
  • The unlinked-view lists are not pruned during a session.

Testing

  • npm run typecheck: clean.
  • npm test: 159 files passed, 7 skipped. 2512 tests passed, 39 skipped.
  • New live and replay delegation snapshots for v1 and v2. Not run against real Codex.

@benbrandt
benbrandt merged commit 6567651 into main Nov 12, 2026
6 checks passed
@benbrandt
benbrandt deleted the feat/subagents-rfd-conformance branch November 12, 2026 15:42
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