Codex blocks first model request on slow MCP tools/list

Open 💬 4 comments Opened Jun 17, 2026 by trackoor

Codex blocks first model request on slow MCP tools/list

What version of Codex CLI is running?

@openai/codex 0.140.0

What subscription do you have?

N/A. The reproduction uses a local OpenAI-compatible mock provider and a fake API key.

Which model were you using?

gpt-4 in the local mock-provider replay.

What platform is your computer?

Linux x86_64 in Docker (node:24-bookworm-based target image).

What terminal emulator and version are you using?

Non-interactive Docker/CI shell.

Codex doctor report

Not available in this minimal Docker reproduction.

What issue are you seeing?

Severity / performance impact: High. A slow MCP tools/list response delays the first provider request, so a local MCP server can block first-turn progress before the model receives the user task.

What steps can reproduce the bug?

Prerequisites: Docker, Python 3, and the GitHub CLI (gh) for the clone command below. The linked reproducer is self-contained and uses only Python standard-library modules plus Docker. It builds the affected CLI version from the public package registry, starts a local mock provider, and runs the CLI in an isolated workspace. The Docker run is limited to 2 CPUs and 4 GiB RAM by default.

Complete self-contained reproducer: https://gist.github.com/N0zoM1z0/c1b0f3c6248f2c7ff44ba9de2197c5c4

The Gist contains codex-mcp-tools-list-blocks-first-turn.reproduce.py. Download and run:

gh gist clone c1b0f3c6248f2c7ff44ba9de2197c5c4 codex-mcp-tools-list-blocks-first-turn-reproducer
cd codex-mcp-tools-list-blocks-first-turn-reproducer
python3 codex-mcp-tools-list-blocks-first-turn.reproduce.py

To reuse an already-built local image:

python3 codex-mcp-tools-list-blocks-first-turn.reproduce.py --skip-build

Expected successful reproduction output includes:

REPRODUCED

Observed evidence

The reproducer configures a local MCP server whose tools/list reply sleeps for 2500 ms. The first provider request is delayed by at least 2000 ms.

What is the expected behavior?

Codex should bound MCP discovery latency or proceed with a clear degraded state instead of blocking the first provider request indefinitely.

Additional information

Public-upstream status: This reproduces against stock public @openai/codex@0.140.0 built from npm.

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗