Repository navigation
Description
What issue are you seeing?
gpt-6.1-terra at medium effort ends its turn early on a long multi-step task when an app-server client starts the turn. The client here is T3 Code. The agent stops after setup or after one step. Its final message accurately says the work is unfinished and that nothing is blocking it. A "continue" message makes it finish.
The same task text, model and effort complete in one turn when the work is started through:
codex exec- a native
spawn_agentchild created inside an app-server thread
The table shows whether the whole task was done in the first turn (same machine, same ~/.codex config):
| Launch path | Full task done in first turn |
|---|---|
app-server turn/start from the client (top-level threads and the client's own delegated child threads) |
0/11 |
native spawn_agent child (source: subagent/thread_spawn) inside an app-server thread |
3/3 |
codex exec (source: exec) |
2/2 |
The samples are small, but the split is consistent.
Through the app-server path, other settings on the same task gave:
| Model and effort | Full task done in first turn |
|---|---|
| terra high | 0/2 |
| terra low | 1/1 |
| terra xhigh | 2/2 |
| gpt-6.1-sol medium | 1/1 |
| gpt-6-luna high | 0/2 |
Differences I found in the rollouts:
- Root role and AGENTS.md: the
codex execsession is also/rootand loads the same global~/.codex/AGENTS.md. Neither explains the gap. - Collaboration Mode: the client sends the full "# Collaboration Mode: Default ..." text in
collaborationMode.settings.developer_instructions. That text includes "If explicit user input is required ... ask the user directly with one concise plain-text question". In theexecandspawn_agentsessions,turn_context.collaboration_mode.settings.developer_instructionsisnull. - Client context: the client also adds its own
additionalContextdeveloper blocks.
I have not isolated which of these two triggers the early stop.
What steps can reproduce the bug?
- Use an app-server client, such as T3 Code, with
gpt-6.1-terraand effortmedium. Start a turn whosecollaborationModeisdefaultwith explicitdeveloper_instructions. - Give it a long file task. Mine was: read a brief and a vocabulary file, process 9 text chunks (201 records) one at a time, append JSONL rows for each chunk, then run a check script. The prompt says: "This is a long task; there is no time limit. Do not end your turn until both output files exist and the final check passes."
- The turn usually ends after 0–1 chunks.
- Run the same prompt with
codex exec -m gpt-6.1-terra -c model_reasoning_effort=medium, or as aspawn_agentchild with model terra and effort medium. It completes all 9 chunks in one turn.
Adding "Continue working toward the overall goal ... Only stop when the entire goal is completed or a genuine blocker prevents further progress" to the prompt did not fix it in the app-server path. In one run it stopped after 1 of 9 chunks.
What is the expected behavior?
The turn continues until the task is complete, as it does in the exec and spawn_agent paths.
Additional information
- codex-cli 0.167.0 on Windows 11 Pro (10.0.26200). Client: T3 Code (Nightly) desktop 0.1.8.0, app-server provider.
- Possibly related reports of the same symptom: Codex keeps stopping or losing the task before the work is done #50771, Codex Desktop repeatedly ends turn after partial progress despite actionable work remaining (macOS, fresh session reproduced) #57843, Codex app intermittently ends a turn after commentary before executing planned tool calls #46153, Codex Desktop stops prematurely after context/task handoff instead of continuing work #33398. Many of those are from Codex Desktop, which is also an app-server client.
- The same report on the client side: [Bug]: Codex turns started by T3 end early on long multi-step tasks; the same model finishes as a native Codex subagent or via
codex execpingdotgg/t3code#32488
Activity
github-actions commentedon Nov 7, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
super148666 commentedon Nov 7, 2026
Update after isolating further. This reproduces with a bare
codex app-serverclient and no T3, and none of the client-supplied extras explain it.Correction: the
codex execsession also gets the built-in<collaboration_mode># Collaboration Mode: Defaulttext.developer_instructions: nullmeans "use the default", so that difference in my report was wrong.Setup: a minimal stdio JSON-RPC client replays the client's
initialize,thread/startandturn/startexactly, with only cwd and output dir changed. Modelgpt-6.1-terra, effort medium,sandboxPolicy: dangerFullAccess,approvalPolicy: never. Each row shows whether the whole task was done in the first turn:additionalContexttools.update_plan.enabledsummary: autoapprovalsReviewer: auto_reviewclientInfo.namecollaborationModeeffortsandboxPolicy+approvalPolicycodex exec, same prompt (same sandbox and reviewer as theauto_reviewrow)codex exec+ the client's context blocks asdeveloper_instructionsspawn_agentchild (source: subagent/thread_spawn) in an app-server threadIn each failing run the model emits
final_answeritself after 1–2 tool calls, within 20–45 s. It is not interrupted. The first-turn model inputs, tools and code-modeexeccalls look the same as in the passingcodex execruns.The visible difference that tracks the outcome is the session source:
vscode(app-server top-level thread) fails, whileexecandsubagentpass. Is session source, or anything else derived from the app-server path, sent with the model request in a way that could change turn-ending behaviour?Caveat: a replay with
turn/startcarrying onlythreadIdandinputcompleted 4/4. That fell back to the workspace-write sandbox with auto-review escalations on most commands, so I don't treat it as clean evidence.I can share the replay script, which contains no private data.
super148666 commentedon Nov 7, 2026
Update: this stopped reproducing for me on the evening of 2026-11-07, without any local change.
turn/start(terra medium)delegate_taskpathNothing local changed in between:
codex.exe0.167.0, binary dated 2026-11-06This points to a server-side change or a time-varying issue, not to anything client-side. I'll report back if it returns. Feel free to close.
Thank you to the Codex team and everyone who reported and discussed the related early-stop issues. If it was a server-side fix, thank you for shipping it.
super148666 commentedon Nov 10, 2026
Update: this did not go away on Nov 7. I found a deterministic trigger, and my earlier "stopped reproducing" was caused by a change in my local default effort.
Trigger
The turn ends early when
turn/startcarries a reasoning effort that differs from the effort the thread started with (model_reasoning_effortfromconfig.toml, or from thethread/startconfig).In that case the rollout has a
response_itemof typeconfiguration_updateright after the user message:{"type":"configuration_update","reasoning":{"effort":"medium"}}Every run with this item ended early. Every run without it completed.
Controlled runs (Nov 10, codex-cli 0.167.0, Windows 11, bare
codex app-serverstdio client)Same task as in the issue (9 chunks, 201 records), same replayed
thread/start+turn/start. The only things varied aremodel_reasoning_effortin thethread/startconfig andeffortinturn/start(also set incollaborationMode.settings.reasoning_effort). Myconfig.tomldefault ismedium.configuration_updatein rolloutRows 1 and 2 run at the same effective effort (medium). The only difference is whether the turn effort matches the thread effort.
In the failing runs the model emits
final_answeritself after 3 to 6 tool calls and says the work is incomplete. It is not interrupted.The Nov 7 data fits the same rule
I re-read the rollouts from my Nov 7 tests (gpt-6.1-terra, medium):
configuration_updateitem. All 21 ended early.threadId+input, the later "post" replays, and one Codex Desktop run). All 7 completed.codex execruns did not have it. All 5 completed.So the variants I removed one at a time (
collaborationMode,effort,sandboxPolicy,additionalContext) kept failing because each of them still left a turn-level effort that differed from the thread's. Nativespawn_agentchildren andcodex execset the effort when the thread is created, so they never get the item.The "post" replays started completing at 23:48 on Nov 7 because my
config.tomldefault had becomemediumby then, which matched the replayed turn effort. I believe that happened when I ran a gpt-6.1-terra medium test in Codex Desktop at 23:31, but I did not record the earlier value, so that part is an inference.Workarounds
model_reasoning_effortinconfig.tomlequal to the effort the client sends inturn/start.model_reasoning_effortin thethread/startconfig, equal to the first turn's effort.Question
Is
configuration_updatewithreasoning.effortexpected to change how the model decides to end the turn? I can attach rollouts for any row above.super148666 commentedon Nov 10, 2026
Correction and more data for my previous comment. I overstated it: the effort mismatch makes the early stop much more likely, but it is not deterministic, and it depends on the task. It also reproduces on macOS.
What still holds
When the turn effort equals the thread effort (no
configuration_updateitem), the turn has never ended early: 11/11 on Nov 10 across two machines (gpt-6.1-terra 9/9, gpt-6-luna 2/2), plus the 12 runs from Nov 7.What I got wrong
"Every run with this item ended early" was true for the runs I had at that point, but later runs on the same day completed with the item present.
All runs below: codex-cli 0.167.0, same replayed
thread/start+turn/start, same real task (201 records in 9 chunks, long free-text fields, chunks up to 26 KB, plus reference documents to read first), turn effort different from thread effort,configuration_updatepresent in every rollout.The macOS early stop looks the same as on Windows:
final_answerafter 77 s with 75 of 201 records done and a message saying the work is incomplete. The two machines have nearly the sameconfig.toml(same features, same default effort). 9/10 against 1/4 may be a platform difference or just a small sample; I cannot tell.Task dependence
With a synthetic task of the same shape (9 chunks, about 200 short templated records, a check script at the end), the mismatch did not cause any early stop on Windows: 5/5 completed with the
configuration_updateitem present (chunks of 8 KB in 2 runs and 17 KB in 3 runs). Only the heavier real task triggers it. This may be why synthetic reproductions pass.Feature flags (Windows, gpt-6.1-terra, mismatch, real task)
My config has
features.multi_agent = truewithmulti_agent_v2and a longusage_hint_text,features.goals = true, andfeatures.context_management.experimental_mode = true. Overriding one at a time on theapp-servercommand line:features.multi_agent_v2.usage_hint_enabled=falsefeatures.multi_agent=falsefeatures.context_management.experimental_mode=falseThe samples are too small to say that the multi-agent settings matter. Early stops still happen with them off.
Summary
Trigger as I now understand it: turn effort differs from thread effort, on a long task with large inputs. It raises the chance of the model ending the turn early from zero observed cases to most runs on my Windows machine. The workaround is unchanged: make the thread effort equal to the turn effort.
Anfet commentedon Nov 13, 2026
Additional data from another setup. Here the early stop also happens for
spawn_agentchildren, not only on the app-server path.Environment: Windows 10 (10.0.19045), codex-cli 0.167.1,
multi_agent_version: v2,approval_policy: never, full access. Two launch paths:spawn_agentchildren of a VS Code extension thread,fork_turns: "none", model and effort set per child;codex app-serverclient (thread/start+turn/start).What counts as an early stop: the turn ends with a final message saying the work is not done, the code is unchanged, and there is no blocker. No patch is applied in that turn.
Counts, 12–14 Nov, one account, three repositories:
spawn_agentchild (VS Code thread)One task, repeated. Card A was given to
gpt-6.1-terralow 7 times:spawn_agentchildren, each 1.5–3.8 min, 11–37 requests;gpt-6.1-solhigh session wrote a concrete implementation approach into the task file.None of these runs finished card A. Final messages, translated: "TODO; implementation and checks not performed; worktree created, no code, no commit". "Not done; code unchanged; concrete blocker not established". "NOT FINISHED; stubs added, not wired; no confirmed blocker".
Card B: a terra low child returned "TODO, implementation not done, no confirmed external blocker" three times. The fourth turn produced the change.
Other cards of similar size, with the same model and effort, completed normally. These are counts from one account, not a failure rate. I can share rollout excerpts with session ids if useful.
Side observation (not verified, please confirm or correct).
~/.codex/hooks.jsonhas PreToolUse hooks with matchersspawn_agentandwait_agent; thespawn_agenthook appends a log line on every call. Across dozens ofspawn_agentlaunches on 0.162–0.167.1 that log was never created, while PreToolUse hooks for shell commands (including commands run inside the code-modeexectool) do run. So it looks like PreToolUse does not fire for collaboration tools, or they are matched under a different (namespaced) name. Is PreToolUse expected to coverspawn_agent/wait_agent, and if so, what matcher name should be used?baktiaditya commentedon Nov 27, 2026
Another data point, codex-cli 0.172.0 (TUI), Linux, full access,
gpt-6.1-terrahigh.{"type":"configuration_update","reasoning":{"effort":"high"}}right after the user message (the model had been switched with/modelearlier in the thread). Terra created a worktree, installed dependencies, and ended the turn after 1m11s with no code. Its final message named an open technical point that the task itself covered, and no blocker.configuration_updateitem in the rollout. It worked for 14m, wrote the code and tests, and opened the PR.One pair, so it proves nothing alone, but it matches the configuration_update trigger described above. Feedback uploaded with logs; thread ID
01a21afd-92be-7ca1-940d-346bb63c002f.