Skip to content

feat: report SendMessage delegations as linked session messages - #1424

Merged
benbrandt merged 1 commit into
mainfrom
feat-send-message-as-session-message
Oct 24, 2026
Merged

benbrandt merged 1 commit into
mainfrom
feat-send-message-as-session-message

Conversation

@benbrandt

Copy link
Copy Markdown
Member

In the subagents RFD form, a SendMessage call to a child now becomes a message between the two sessions, as a launch's prompt already does (#1405). Before, it was a tool call of its sender plus an unlinked message in the child. Every delegation now has a parent-side message, which a client can anchor a per-delegation card on, and both views name each other with senderMessageId/recipientMessageId.

Live

  • The call is held until its final update. The SDK reports that the message resumed a child before it reports the call's result.
  • Message reached an announced child: the sender gets the outgoing view and the child the incoming one (linkedSessionMessages). The call's result isn't shown.
  • Message reached no announced child, for example one sent to the parent: the call is shown after all, with its final status (unexposedControlFallback).
  • Call a permission request already showed: it keeps its updates, and its message goes only to the child.

Replay

  • A child's history replays right after its launch, so a call from a parent to its child is always matched to its delivery first.
  • The child's view then names the call, and the sender's view goes out where the call sits.
  • A call the replay reaches before its delivery stays a tool call, unlinked. That can happen with a child's message to a sibling whose history replays later.

publishPrompt's replacesLaunch option is now replacesCall.

Testing

  • Live: the existing SendMessage tests in native-subagents.test.ts and acp-agent.test.ts now expect both views and check that the call and its completed result are hidden. A new test checks that a call reaching no announced child is shown with its final status.
  • Replay: the existing test expects the linked views in place of root tool_call toolu_send. A new test covers a call reached before its delivery, and fails if delivery ignores that the call was already shown.
  • npm run check, npm run build and npm run test:run (3301 tests) pass locally.

Not tried against a real Claude Code run yet.

@benbrandt
benbrandt marked this pull request as ready for review October 24, 2026 21:29
In the RFD form, a SendMessage call to a child now becomes a message
between the two sessions, as a launch's prompt already does, instead of
a tool call of its sender plus an unlinked message in the child.

Live, the call is held until its final update. When its message reaches
an announced child (the SDK reports that before the call's result), the
sender gets the outgoing view and the child the incoming one, each
naming the other. A call whose message reached no announced child, such
as one to the parent, is shown after all with its final status, and a
call a permission request already showed keeps its updates.

On replay, a child's history follows its launch, so a call to a child
from its parent is matched to its delivery first: the child's view names
the call, and the sender's view goes out where the call is. A call the
replay reaches before its delivery stays a tool call, unlinked.
@benbrandt
benbrandt force-pushed the feat-send-message-as-session-message branch from 1078c13 to 1ea8a68 Compare October 24, 2026 21:33
@benbrandt
benbrandt merged commit 739dde3 into main Oct 24, 2026
6 checks passed
@benbrandt
benbrandt deleted the feat-send-message-as-session-message branch October 24, 2026 22:14
benbrandt pushed a commit that referenced this pull request Oct 26, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.96.0](v0.95.0...v0.96.0)
(2026-10-26)


### Features

* report SendMessage delegations as linked session messages
([#1424](#1424))
([739dde3](739dde3))
* report the model of each native subagent
([#1432](#1432))
([c319e5e](c319e5e))


### Bug Fixes

* do not hold an AIR load replay until the CLI starts
([#1433](#1433))
([eb9d63e](eb9d63e))
* refine RFD child models after a load, and retry a failed model update
([#1434](#1434))
([9a8bf71](9a8bf71))
* send subagents' current state after a load response
([#1423](#1423))
([17a967b](17a967b))
* update to Claude Code 2.1.310
([#1435](#1435))
([2f3c6bb](2f3c6bb))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: acp-release-bot[bot] <246668977+acp-release-bot[bot]@users.noreply.github.com>
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