Skip to content

exec: non-required MCP servers let the first turn start with no tools #26

Open

Description

@thedancingdeveloper

Problem

codex exec (0.162.0+fork.ca04973b4) starts a turn while a stdio MCP server that is not marked required is still handshaking. The first request of the turn carries none of that server's tools. Each exec / exec resume restarts the servers, so the first one or two calls of every turn are affected.

A model that names tools it read in instructions (for example Claude Haiku 5.5) then emits mcp__<server>__<tool> or a bare tool name with no namespace. Codex answers function_call_output: "unsupported call: <name>" and the call never reaches the server. Models that poll list_mcp_resources until tools appear hide the problem, so behaviour depends on timing.

Reproduction

A fake stdio MCP server that sleeps 25s before answering initialize, not marked required: the first request lists only the other servers' tools, and the model reports the tool unavailable. With required = true the same run succeeds.

Requested changes

  1. exec should wait for every enabled server's startup (bounded by startup_timeout_sec), not only required ones.
  2. Resolve mcp__<server>__<tool> names, and bare tool names that are unique across servers, when they arrive without a namespace.
  3. Return "server still starting" instead of "unsupported call" when the named server has not finished its handshake.

Downstream workaround: msp-agent renders required = true on every [mcp_servers.*] (Versent/msp-agent#33). Tracked as Vogt WI-1514.

Activity

  1. thedancingdeveloper commented on Oct 14, 2026

    @thedancingdeveloper
    Author

    Fix in PR #27 (#27), head 2dbd27c, targeting integrate/codex-next.

    • exec now waits for every enabled MCP server, each bounded by its startup_timeout_sec. A failed server is printed as a warning.
    • Flattened mcp____ names, and bare names unique across servers, now resolve to the MCP tool.
    • A call to a server still handshaking returns 'still starting'.

    Gates: fmt clean; clippy -D warnings clean (core, exec, codex-mcp, rmcp-client); the targeted core integration tests pass 8/8, core registry 44/44, exec 64/64, codex-mcp 255/255. The full core suite was not run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions