Codex MCP tool responses omit conversation metadata, blocking codex-reply
What version of Codex is running?
OpenAI Codex (v0.49.0)
What subscription do you have?
Plus
Which model were you using?
gpt-5-codex
What platform is your computer?
Linux 6.17.4-200.fc42.x86_64 x86_64
What issue are you seeing?
Codex MCP tool responses omit conversation metadata, blocking codex-reply
What steps can reproduce the bug?
- Launch codex mcp-server and connect via an MCP client (e.g., Inspector).
- Call the codex tool with any prompt.
- Inspect the tools/call response: it only includes the assistant text (“Hey You! …”) and structured_content: null; no conversationId is returned, so you can’t call codex-reply.
What is the expected behavior?
tools/call responses should include structured metadata (at least conversationId, ideally model/rollout info) so clients can resume the session via codex-reply, matching the docs (docs/advanced.md and codex_r*s/docs/codex_mcp_interface.md).
Additional information
In codex-rs/mcp-server/src/codex_tool_runner.rs, capture the conversation_id and SessionConfiguredEvent when starting a new conversation, wrap them in a helper (e.g., ConversationContextSnapshot), and pass that snapshot through run_codex_tool_session_inner. When handling EventMsg::TaskComplete, set CallToolResult.structured_content = snapshot.structured_content() so the response contains { "conversationId": "...", "model": "...", … }. Unit tests covering the serializer are included in the attached patch.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗