codex - 💡(How to fix) Fix Add agent/subagent metadata to SDK streaming ThreadEvent items [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#20979Fetched 2026-05-05 05:55:05
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

Error Message

For clients that render live activity timelines, grouped logs, or debugging views, it is important to know which agent produced a message, reasoning item, tool call, todo update, or error. Today, the TypeScript SDK exposes item types such as agent_message, reasoning, command_execution, mcp_tool_call, todo_list, and error, but those streamed items do not appear to include stable identity metadata for the active agent/subagent.

RAW_BUFFERClick to expand / collapse

What feature would you like to see?

Could @openai/codex-sdk streaming events include explicit metadata for the agent or subagent responsible for each ThreadEvent item?

For clients that render live activity timelines, grouped logs, or debugging views, it is important to know which agent produced a message, reasoning item, tool call, todo update, or error.

Today, the TypeScript SDK exposes item types such as agent_message, reasoning, command_execution, mcp_tool_call, todo_list, and error, but those streamed items do not appear to include stable identity metadata for the active agent/subagent.

Suggested fields could include:

  • agent_id
  • agent_name
  • agent_kind, for example main or subagent
  • parent_agent_id, when applicable
  • parent_item_id or parent_thread_id, when applicable

This would let client applications attribute streamed activity directly, without relying on event ordering heuristics, transcript parsing, or provider-specific implementation details.

Related: #20675 covers similar root/subagent metadata for hook payloads; this request is specifically for SDK streaming ThreadEvent items.

extent analysis

TL;DR

The @openai/codex-sdk should be updated to include explicit metadata for the agent or subagent responsible for each ThreadEvent item in streaming events.

Guidance

  • Review the existing ThreadEvent item types (e.g., agent_message, reasoning, command_execution) to determine if any current fields can be leveraged to identify the responsible agent.
  • Consider adding the suggested fields (agent_id, agent_name, agent_kind, parent_agent_id, parent_item_id, or parent_thread_id) to the ThreadEvent items to provide stable identity metadata.
  • Evaluate the relationship between this request and the related issue #20675, which covers similar root/subagent metadata for hook payloads.
  • Investigate the feasibility of implementing a workaround that utilizes event ordering heuristics or transcript parsing to attribute streamed activity to the responsible agent.

Example

No code snippet is provided as the issue is focused on feature enhancement rather than a specific code-related problem.

Notes

The implementation of this feature may require significant changes to the @openai/codex-sdk and its underlying infrastructure. The suggested fields may need to be standardized across different agent types and subagents.

Recommendation

Apply workaround: While waiting for the @openai/codex-sdk to be updated, client applications can attempt to attribute streamed activity using event ordering heuristics or transcript parsing as a temporary solution.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Add agent/subagent metadata to SDK streaming ThreadEvent items [1 comments, 2 participants]