Timed out shell-command invocation discards command output

Open 💬 0 comments Opened Jul 22, 2026 by RigoLigoRLC

What version of the Codex App are you using (From “About Codex” dialog)?

ChatGPT Powered by Codex & OWL Version 26.715.72359 Released 22 Jul 2026

What subscription do you have?

ChatGPT Pro 5x

What platform is your computer?

Microsoft Windows NT 10.0.22631.0 x64

What issue are you seeing?

If a long-running command was terminated by a shell-command timeout, then the commands' output is discarded and the model cannot see it.

What steps can reproduce the bug?

May be reproduced by creating a file named codex-shell-timeout-repro.ps1:

param(
    [int]$IntervalMilliseconds = 1000
)

# This program intentionally never exits. It writes and flushes stdout once per
# interval so that a command runner can prove whether it preserves output when
# it terminates a long-running child process because of its own timeout.
$sequence = 0
while ($true) {
    [Console]::Out.WriteLine("stdout tick $sequence")
    [Console]::Out.Flush()
    $sequence++
    Start-Sleep -Milliseconds $IntervalMilliseconds
}

And ask Codex do:

Please reproduce a suspected shell-command output-loss bug.

Run this command with a timeout of approximately 12 seconds:

pwsh -NoProfile -File .\codex-shell-timeout-repro.ps1

The script intentionally runs forever, writes one line to stdout every second,
and explicitly flushes stdout after every line.

After the command times out, report the complete command output exactly as it
was returned by the execution tool. Do not replace the command with a
background process, redirect output to a file, or stop it manually before the
tool timeout.

Expected behavior: the timeout result includes the stdout lines emitted before
termination, such as `stdout tick 0` through `stdout tick 11`.

Observed behavior: the execution tool reports only exit code 124 / timeout and
returns none of the already flushed stdout lines.

Explicitly report "Reproduced" if this was the case.

Codex will output:

````
Reproduced

Script error:
Exit code: 124
Wall time: 16 seconds
Output:
command timed out after 16030 milliseconds

````

What is the expected behavior?

Long-running command's output should be preserved after timeout termination.

Additional information

This also reproduces on Codex CLI 0.145.0 running on the same host.

View original on GitHub ↗