Skip to content

fix(core): instrument stalled tool-listing handoff#24667

Merged
apanasenko-oai merged 1 commit into
mainfrom
codex/tool-listing-trace-instrumentation
May 27, 2026
Merged

fix(core): instrument stalled tool-listing handoff#24667
apanasenko-oai merged 1 commit into
mainfrom
codex/tool-listing-trace-instrumentation

Conversation

@apanasenko-oai
Copy link
Copy Markdown
Collaborator

@apanasenko-oai apanasenko-oai commented May 27, 2026

Why

When a turn needs a follow-up request after tool output is recorded, Codex can still appear stuck in Thinking before the next /responses request is opened. The existing local trace showed the last completed response and the absence of a new backend request, but it did not show whether the stall was in tool-router preparation or later request setup.

Issue: N/A (internal incident investigation)

What Changed

Added trace spans around the pre-stream tool-router handoff in core/src/session/turn.rs, including the built_tools phase and the MCP manager read lock.

Added per-server MCP tool-listing spans and trace breadcrumbs in codex-mcp/src/connection_manager.rs with startup snapshot / startup-complete state so a pending MCP client is visible in feedback logs instead of looking like a silent hang.

Verification

  • just fmt
  • just test -p codex-mcp
  • just test -p codex-core (prior full rerun fails in this workspace on unrelated integration tests: code-mode output length expectations, one shell timeout formatting assertion, and shell snapshot timeouts; latest review-fix rerun compiled and passed 1160 tests before I stopped the abnormally slow unrelated suite)

@apanasenko-oai apanasenko-oai changed the title instrument stalled tool-listing handoff fix(core): instrument stalled tool-listing handoff May 27, 2026
@apanasenko-oai apanasenko-oai force-pushed the codex/tool-listing-trace-instrumentation branch from 1368cf6 to 400beb9 Compare May 27, 2026 00:48
@apanasenko-oai apanasenko-oai marked this pull request as ready for review May 27, 2026 00:51
@apanasenko-oai apanasenko-oai requested a review from a team as a code owner May 27, 2026 00:51
Comment thread codex-rs/core/src/session/turn.rs
@apanasenko-oai apanasenko-oai force-pushed the codex/tool-listing-trace-instrumentation branch from 400beb9 to 5f0dedd Compare May 27, 2026 01:34
@apanasenko-oai apanasenko-oai force-pushed the codex/tool-listing-trace-instrumentation branch from 5f0dedd to 15497be Compare May 27, 2026 01:39
@apanasenko-oai apanasenko-oai enabled auto-merge (squash) May 27, 2026 01:41
@apanasenko-oai apanasenko-oai merged commit 64e340a into main May 27, 2026
31 checks passed
@apanasenko-oai apanasenko-oai deleted the codex/tool-listing-trace-instrumentation branch May 27, 2026 02:00
@github-actions github-actions Bot locked and limited conversation to collaborators May 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants