GPT-5.6 Terra abandons yielded exec_command sessions after ~10s and attempts duplicate commands
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start by running the two-sleep reproduction with Codex CLI 0.144.5, then trace the exec_command and write_stdin session lifecycle. Review related issues #14731, #15723, #13733, and #32188. Done means a live session is observed through completion or explicitly detached before another foreground command starts.
Written by the indexing model from the issue text.
Description
What version of Codex CLI is running?
codex-cli 0.144.5
What subscription do you have?
ChatGPT Pro
Which model were you using?
gpt-5.6-terra, high reasoning effort
What platform is your computer?
Linux x86_64
What issue are you seeing?
GPT-5.6 Terra does not reliably preserve ownership of an exec_command after the command crosses the default ~10 second yield boundary and becomes a background terminal.
In a minimal reproduction using two one-minute sleeps, Terra:
- Started the first
sleep 1m. - Correctly acknowledged that the first terminal was still running.
- Later stated that the first sleep had completed, without first observing completion through
write_stdin. - Attempted to start the second
sleep 1mwith a newexec_commandwhile Codex still considered the first Bash session active. - A local serialization
PreToolUsehook blocked the second command and returned:Another Bash command is still running for this Codex session. Continue polling that terminal with write_stdin until it exits. - Only after receiving that rejection did Terra poll/close the original terminal and then start the second sleep.
The hook prevented actual overlap, but it proves that Terra inferred or fabricated process completion and attempted a duplicate command while the original Codex terminal session remained live.
In normal use without this guard, the same failure pattern results in 3–4 background terminals running the same build/test command.
Steps to reproduce the bug
- Use Codex CLI 0.144.5 with
gpt-5.6-terraat high reasoning effort. - Ask:
run one sleep 1m. - Before or shortly after it yields, ask again:
run one sleep 1m. - Observe whether Terra continues polling the original
session_idwithwrite_stdinuntil a terminal result is returned. - In the uploaded reproduction, Terra instead claimed completion and attempted a new
exec_commandwhile the previous session was still active.
A serialization hook was installed only to make the race observable and prevent duplicate process execution. write_stdin remained allowed, while a new Bash/exec_command was blocked if the existing session lock was still held.
Expected behavior
Once exec_command returns a live session_id, Codex should maintain a deterministic invariant:
- the model must continue that same session through
write_stdin, or - the runtime should wake the thread when the process exits, or
- the process must be explicitly detached/abandoned before another foreground command may start.
The model should never report that a process completed unless a terminal result with an exit status was actually observed.
A new exec_command should not be started while the previous serialized foreground process is still live.
Why this appears GPT-5.6-specific
The same long-running workflows are reliable for me with GPT-5.5 medium. Both GPT-5.6 Terra and Sol frequently lose the yielded terminal session, treat it as detached or completed, and start the command again.
Commands finishing inside the initial synchronous window generally work. Reliability drops sharply once the command lasts longer than the default yield_time_ms = 10000 and requires session continuation through write_stdin.
Uploaded thread
019f6cfe-82b5-7823-9310-33d871096ac5
The uploaded feedback contains the complete minimal session and screenshot.
Related issues
- #14731 — turn completes while unified-exec background processes are still running
- #15723 — background subprocesses do not wake the calling agent
- #13733 — repeated
write_stdinpolling wastes full model turns - #32188 — event-driven wakeup when background exec sessions complete
This report is specifically about the GPT-5.6 model-side consequence: losing the live session invariant, falsely asserting completion, and attempting duplicate command execution.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- Avg merge
- 1m
- Merged PRs (30d)
- 1k
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openai/codex
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
bug CLI windows-os
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
macOS sandbox blocks hw.optional.arm64 sysctl, causing Flutter to misdetect Apple Silicon as x64 Openbug CLI sandbox
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug CLI TUI
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
CLI config enhancement skills
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
A-linter
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oxc-project/oxc#26863 ·