Feature request: subagent completion notifications should split token usage, name the resolved model, and cover killed agents
Summary
Subagent completion notifications report a single opaque subagent_tokens total. For orchestration workflows that need spend attribution, that figure is insufficient in four specific ways:
- No input/output/cache split. Cost cannot be computed from a bare token total — cache reads, cache writes, input, and output are priced differently (order-of-magnitude spread). A cost audit built on these totals carries ±20% error bars.
- Resolved model is not named. The notification doesn't say which model actually served the agent (frontmatter tier, per-call override, or fallback), so the total can't even be priced approximately.
- Descendant inclusion is unspecified. When a subagent spawns its own children (e.g. a review gate fanning out to N reviewers), it is undocumented — and empirically unclear — whether the parent's
subagent_tokensincludes the descendants. Observed figures for gates with 5+ nested reviewers look implausibly low for the work performed, but there's no way to confirm from the notification. - Killed agents report nothing. An agent that dies mid-run (e.g. transient provider 5xx after retries) produces no usage at all, though its spend was real and metered.
Ask
In the completion (and failure) notification's usage block: split input/output/cache-read/cache-write tokens, name the resolved model ID, add a boolean or count indicating whether/how many descendant agents are included in the totals, and emit a final usage block even when the agent terminates on error.
Why it matters
Orchestrator sessions that follow bounded-return discipline (never reading child transcripts, which cost ~1MB of context per read) have the notification as their only in-session usage signal. Everything above is already metered server-side; this is exposure, not new measurement. The current workaround is post-hoc parsing of per-agent transcript JSONL + meta.json files, which is undocumented-format territory and unavailable for killed agents.
Context
Identified during a cost audit of a multi-agent orchestration session: per-step attribution had to be reconstructed from conversation memory and reconciled against /usage model totals, with dead gates estimated blind.