Skip to content

fix(session-relay): Codex MCP wiring — direct server map + sh cache-glob resolver#6

Merged
DocksDocks merged 1 commit into
mainfrom
fix/codex-mcp-wiring
Jul 2, 2026
Merged

fix(session-relay): Codex MCP wiring — direct server map + sh cache-glob resolver#6
DocksDocks merged 1 commit into
mainfrom
fix/codex-mcp-wiring

Conversation

@DocksDocks

Copy link
Copy Markdown
Owner

Live verification of the rust-port plan's Codex leg found the bus never loaded on Codex — two root causes, both empirically confirmed on codex 0.142.5 (latest):

  1. Wrong wrapper: Codex parses only a direct server map or snake_case mcp_servers; our camelCase mcpServers was silently ignored (latent since 0.1.0 — the Node form never loaded either).
  2. No variable mechanism: a RUST_LOG trace shows ${PLUGIN_ROOT} reaching spawn unsubstituted, and an env-dump probe shows MCP children get no PLUGIN_ROOT/CLAUDE_PLUGIN_ROOT env (hooks do get them) — openai/codex#19372, still open.

The plan's STOP condition fired and its prescribed fallback ships here: sh -c tries $PLUGIN_ROOT first (future-proof for the upstream fix), else execs the newest ~/.codex/plugins/cache/*/session-relay/*/bin/relay.

Live-verified: whoami and roster answer with real JSON over the plugin MCP handshake in real codex exec sessions. Plan Interfaces table, acceptance criterion, STOP condition, and Mistakes & Dead Ends updated to the verified forms. node scripts/ci.mjs green.

Remaining live legs (interactive-only): Codex hook trust approval (one-time prompt) + the full Claude⇄Codex round-trip.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UyDDEDsq6yGeJKzNAwW3ZQ

…lob resolver (live-verified)

Two live-verified root causes on codex 0.142.5 (latest):
(1) Codex parses only a DIRECT server map or snake_case mcp_servers —
our camelCase mcpServers wrapper was silently ignored, so the bus
never loaded on Codex (latent since 0.1.0).
(2) Codex substitutes ${PLUGIN_ROOT} nowhere in MCP config (command
OR args) and exports no PLUGIN_ROOT env to MCP children (only hooks
get it) — openai/codex#19372, still open. The plan's STOP condition
fired; shipped its prescribed fallback: sh -c tries $PLUGIN_ROOT
first (future-proof), else execs the newest
~/.codex/plugins/cache/*/session-relay/*/bin/relay.
Verified live: whoami + roster answer over the plugin MCP handshake
in a real codex exec session. Plan Interfaces/acceptance/STOP/M&DE
updated to the verified forms.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UyDDEDsq6yGeJKzNAwW3ZQ
@DocksDocks DocksDocks merged commit bbbc338 into main Jul 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant