basic_streaming.ts sample does not handle web_search, mcp_tool_call, and error item types

Open 💬 1 comment Opened May 21, 2026 by halilxibrahim

What is the type of issue?

Documentation is missing

What is the issue?

The basic_streaming.ts sample handles agent_message, reasoning,
command_execution, file_change, and todo_list — but skips three
item types that are defined in items.ts:

  • web_search (query field)
  • mcp_tool_call (server + tool + status fields)
  • error (message field)

A developer copying this sample as a starting point would silently
drop these events. Suggested fix: add these cases to handleItemCompleted.

I'm happy to submit a PR if invited.

Where did you find it?

https://github.com/openai/codex/blob/main/sdk/typescript/samples/basic_streaming.ts

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗