SDK result messages now include a summary of the subagents your session started.
What's wrong with this entry?
Every result message the SDK emits carries a new subagent_stats block summarising the subagents the Agent tool started this session. It is on the published result schema as an optional field marked internal, ships to every SDK consumer on this build with no flag, and is attached on success, on budget exhaustion, and on both structured-output retry-exhaustion errors.
- Counters include subagents actually started (a refused or failed launch is not counted), how many were requested background, foreground or unset, how many ended up in the background, counts by agent type, maximum spawn depth, and spawns made from inside another subagent.
- Also tracked: completed, failed, killed split into parent/user/system, and refused split into depth limit, concurrency limit and budget. A user cancel records a kill attributed to the user.
task_startedandtask_notificationevents gainedis_backgroundedandspawn_depth.- Snapshot failures are caught and dropped, so a result is still emitted without the block. Nothing in the build reads the field locally; it exists for whoever consumes the result stream.
@internal Running totals of the subagents the Agent tool started this session; see SDKSubagentStats., Subagents actually started (one tengu_agent_tool_selected each); a refused or failed launch is not counted., subagent_stats, Spawns made from inside another subagent (depth > 1).
Strings lifted out of the shipped bundle, so the claim above can be checked against them.
Related
Other releases about the same thing. Found by shared names or similar wording; neither means one caused the other.
-
v2.1.234
Another forged control tag is escaped in subagent output
Both mention subagent
-
v2.1.234
Spawned processes get
--flag=valuewhen the value looks like a flagBoth mention subagent
-
v2.1.235
New error for delegating to a subagent without naming one
Both mention subagent