Skip to content

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

Merged
SteveSandersonMS merged 2 commits into
github:mainfrom
rinceyuan:docs/subagent-event-fields
Jul 28, 2026
Merged

docs: document complete sub-agent event data fields#2072
SteveSandersonMS merged 2 commits 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!

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@SteveSandersonMS SteveSandersonMS left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the documented fields against all six generated SDK bindings, completed the canonical event reference, corrected zero-value handling in the TypeScript example, and ran the TypeScript docs validator successfully.

@SteveSandersonMS
SteveSandersonMS added this pull request to the merge queue Jul 28, 2026
Merged via the queue into github:main with commit 7bed2e5 Jul 28, 2026
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.

2 participants