codex icon indicating copy to clipboard operation
codex copied to clipboard

Codex MCP tool responses omit conversation metadata, blocking codex-reply

Open HumanSulfate opened this issue 1 year ago • 3 comments

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?

  1. Launch codex mcp-server and connect via an MCP client (e.g., Inspector).
  2. Call the codex tool with any prompt.
  3. 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.

conversation_id.patch

HumanSulfate avatar Oct 25 '25 03:10 HumanSulfate

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #4651
  • #3712

Powered by Codex Action

github-actions[bot] avatar Oct 25 '25 03:10 github-actions[bot]

bump

aavetis avatar Jan 05 '26 12:01 aavetis

We are not planning to make further investments in the Codex MCP server.

etraut-openai avatar Mar 20 '26 06:03 etraut-openai