What
When tool-result events are streamed through the SDK for the Task tool (used to launch subagents) and one other tool, they can now be enriched with an agentId (looked up via a new mapper) and a durationMs value pulled from the tool result, when those are present.
Why
This lets SDK consumers see which agent produced a streamed result and how long it took, useful for tracking subagent work as it streams in.
Names in the bundleagentIddurationMs
Documented inclaude-code/agent-sdk/python
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.
Confirmed since
Anthropic's documentation has since written up durationMs, on Agent SDK reference - Python.
"durationMs": int, # Time taken to run the search, in millisecondsagent-sdk/python see the edit
Confirmed since
Anthropic's documentation has since written up agentId, on Agent SDK reference - TypeScript.
| `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
One source agreesOne thing we can check says the same as this entry.
Anthropic's documentation agrees
Anthropic's documentation has since written up agentId, on Agent SDK reference - TypeScript.