The plugin host operations $.session.messages and $.session.send now accept an optional {agentId, as} argument, where as must be "api" if it's given at all. Passing this lets a caller scope the call to a particular agent within a session, instead of always operating on the whole session.
This lets plugins and SDK integrations work with the messages or output of one specific agent rather than the entire session, which matters when a session involves multiple agents.
The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.
| `parent_agent_id` | `string \| null` | For messages from a [nested subagent](/docs/en/sub-agents#let-subagents-spawn-their-own-subagents), the `agentId` of the subagent that spawned it. `null` for main-session messages, messages from top…agent-sdk/typescript see the edit
Anthropic's documentation has since written up agentId, on Agent SDK reference - TypeScript.