@openai/codex-sdk: ThreadItem type missing collab_tool_call
Open 💬 0 comments Opened Jun 15, 2026 by chrisyy2003
What happened?
@openai/codex-sdk emits collab_tool_call items at runtime when subagents are used, but the exported TypeScript ThreadItem union does not include this item type.
Checked versions:
@openai/codex-sdk@0.139.0@openai/codex-sdk@0.140.0-alpha.19
Runtime event example:
{
"type": "item.completed",
"item": {
"id": "item_0",
"type": "collab_tool_call",
"tool": "spawn_agent",
"sender_thread_id": "019ecb5a-ce95-7653-9214-6d152cd7f5e3",
"receiver_thread_ids": ["019ecb5b-0644-7500-9f5e-317a21ad58a4"],
"agents_states": {
"019ecb5b-0644-7500-9f5e-317a21ad58a4": {
"status": "pending_init",
"message": null
}
},
"status": "completed"
}
}
Expected behavior
The TypeScript SDK should export a CollabToolCallItem type and include it in ThreadItem.
The Rust exec event source already appears to define this as CollabToolCallItem in codex-rs/exec/src/exec_events.rs, and the runtime emits it correctly.
Why this matters
Subagent tracing works at runtime, but TypeScript consumers have to cast event.item to unknown / any to handle official SDK events. This makes subagent trace parsing unnecessarily unsafe.