fix(core): instrument stalled tool-listing handoff#24667
Merged
Conversation
1368cf6 to
400beb9
Compare
pakrym-oai
reviewed
May 27, 2026
pakrym-oai
approved these changes
May 27, 2026
400beb9 to
5f0dedd
Compare
5f0dedd to
15497be
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
When a turn needs a follow-up request after tool output is recorded, Codex can still appear stuck in
Thinkingbefore the next/responsesrequest 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 thebuilt_toolsphase and the MCP manager read lock.Added per-server MCP tool-listing spans and trace breadcrumbs in
codex-mcp/src/connection_manager.rswith startup snapshot / startup-complete state so a pending MCP client is visible in feedback logs instead of looking like a silent hang.Verification
just fmtjust test -p codex-mcpjust 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)