Skip to content

docs: document complete sub-agent event data fields#2072

Open
rinceyuan wants to merge 1 commit into
github:mainfrom
rinceyuan:docs/subagent-event-fields
Open

docs: document complete sub-agent event data fields#2072
rinceyuan wants to merge 1 commit into
github:mainfrom
rinceyuan:docs/subagent-event-fields

Conversation

@rinceyuan

Copy link
Copy Markdown
Contributor

Summary

Document the complete set of data fields available on sub-agent lifecycle events (subagent.started, subagent.completed, subagent.failed) in the custom agents feature documentation.

The event reference table was missing several fields that are present in the typed interfaces (SubagentStartedData, SubagentCompletedData, SubagentFailedData):

Event Added fields
subagent.started model?
subagent.completed model?, durationMs?, totalTokens?, totalToolCalls?
subagent.failed model?, durationMs?, totalTokens?, totalToolCalls?

These fields are useful for embedders building observability/telemetry around sub-agent performance (e.g., tracking per-agent duration, token efficiency, and tool call patterns).

Also updated the Node.js code example to demonstrate accessing the performance metrics from completed/failed events.

Validation

  • Verified field names and optionality against nodejs/src/generated/session-events.ts interfaces
  • No code changes; docs-only PR

The event table for sub-agent lifecycle events was missing several
fields that are available in the typed event interfaces:

- subagent.started: add \model?\
- subagent.completed: add \model?\, \durationMs?\, \	otalTokens?\, \	otalToolCalls?\
- subagent.failed: add \model?\, \durationMs?\, \	otalTokens?\, \	otalToolCalls?\

Also update the Node.js code example to demonstrate accessing
the performance metrics (duration, tokens, tool calls) from
completed/failed events.
@rinceyuan
rinceyuan requested a review from a team as a code owner July 24, 2026 03:12
@rinceyuan

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree company=Microsoft

@rinceyuan

Copy link
Copy Markdown
Contributor Author

@roji Small docs-only fix — the sub-agent event table was missing performance fields (durationMs, totalTokens, totalToolCalls, model) that are present in the typed interfaces. Useful for embedders building observability dashboards. Quick review appreciated!

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