Repository navigation
fix(server): Codex waits for request_secret instead of ending its turn - #42767
juliusmarminge wants to merge 1 commit into
Conversation
Codex ran request_secret from Code Mode, which yields the call after about 30 seconds and lets the model keep polling it. The model eventually ended the turn, which closed the secret card as cancelled and told the agent to ask again. request_secret now joins t3_thread_wait and delegate_task on the direct-only t3-code-direct server, so Codex calls it as a plain blocking tool. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Other scenariosAll 64 scenario measurements match All 64 scenario measurements
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
With Codex, an agent that asked for a secret kept working while the secret card was open and ended its turn after a few minutes. T3 then closed the card as cancelled and told the agent to ask again, so the card disappeared and the agent could re-ask in a loop. Codex was running
request_secretfrom Code Mode, which returns control to the model while a call is still pending.request_secretnow joinst3_thread_waitanddelegate_taskon the direct-onlyt3-code-directMCP registration, so Codex calls it as a plain tool call that waits for the user's answer.Fixes #42749
Reproduction on main
Commit e8fb0a0 (origin/main). Ran
T3CODE_DEV_SEED=0 vp run devin a fresh worktree and drove the web app in a browser. Thread 1, Codex GPT-6-Astra: sent 'Use request_secret right now (label "Test API token", reason "triage repro"). Do nothing else; report the tool's result in one line.' The secret card opened at 10:59:14 UTC and I left it unanswered. The provider log shows Codex accepting the MCP elicitation and leaving the mcpToolCall in progress while the model kept sampling every 20-60 s (about 600k tokens). At 11:06:34 the model ended the turn ('request_secret was invoked ... it remains pending with no result returned'). turn/completed came at 11:06:35.433, and T3 then marked the secret_request turn item cancelled (11:06:35.592; the UI shows 'Test API token · Request ended'). The MCP POST returned after 440.7 s with {status:'cancelled', note:'The card closed with the run. Ask again with a new clientRequestId only if the secret is still needed.'}. That was before the 10-minute server timeout and without any user action. Thread 2, Claude Haiku 5.5, same prompt at 11:04:30: the call blocked correctly, and the card was still pending with the run still running at 11:12. I did not see the follow-up re-ask turn myself, because the prompt told the agent to do nothing else; the note returned to the agent tells it to ask again.Evidence
Requested a secret with the triage prompt on both builds and left it unanswered. Real web app, Chromium at 1280×800, light theme, isolated synthetic state; Codex CLI 0.172.0, GPT-6-Astra Medium, with Code Mode enabled on both sides.
Base yielded the nested call after 31 seconds and consumed 611,892 input tokens while polling. Head made one direct blocking request_secret call and received its result only after Decline.
Reproduction script · Sanitized event timeline
Not shown:
Tests
vp test run src/orchestration-v2/Adapters/CodexAdapterV2.test.ts(apps/server): 224 passedvp run check:changed: format, lint, knip, graphql, typecheck (3 packages) and tests (2 files) all passcodex exec(0.172, features.code_mode=true) against a stub MCP tool that sleeps 100 s. On the default registration the model polled with 9waitcalls; withomit_tools_from=["code_mode","deferred"]it was one blocking callNot in this change
Who did the work
Run by the t3code factory in T3 Code.