Repository navigation
Description
What variant of Codex are you using?
CLI (codex exec), 0.160.0, Linux x86_64
What feature would you like to see?
A configuration option that sets a minimum (or a fixed override) for the
yield_time_ms the model passes to exec_command and to empty-input
write_stdin polls. For example:
[unified_exec]
min_yield_time_ms = 30000 # exec_command and empty write_stdin polls
# or: yield_time_ms_override = 30000Both calls already return as soon as the process exits, so a minimum costs
nothing for commands that finish. It only stops the tool from handing control
back to the model while a short command is still running.
Why
The model often chooses yield_time_ms: 1000 for commands that take a few
seconds. exec_command then returns Process running with session ID N. The
model calls write_stdin with empty input to check again, often with
yield_time_ms: 1000 again. Each check is a full model request that re-sends
the whole conversation.
In one day of non-interactive codex exec sessions we measured 634 such polls,
which re-sent 95.6M input tokens, about 9% of all input. In a sample of 187
polled commands the median runtime was 1 s and p90 was 7.5 s. 186 of the 187
finished within 30 s, so a 30 s minimum would have avoided almost every poll.
Today there is no way to set this:
exec_commandclampsyield_time_msto 250–30,000 ms, and the model picks
the value. There is no config key for a minimum or a default.background_terminal_max_timeoutonly raises the maximum for empty polls.- A
PreToolUsehook'supdatedInputcan only rewritecommand, not
yield_time_ms. features.code_mode.default_exec_yield_time_msapplies only to code-mode
execcells, not to directexec_commandcalls.- Instructions asking the model to use 30000 help but are not enforced.
Reproduction
- Run
codex execagainst any Responses endpoint, or a local stub that
returns afunction_callforexec_commandwith
{"cmd": "sleep 4; echo done", "yield_time_ms": 1000}. - The tool output is
Wall time: 1.0 seconds/
Process running with session ID N, and the next model request is sent
after about 1 s. - With
{"yield_time_ms": 30000}the same command returns
Process exited with code 0/doneafter about 4 s in a single request.
That is the behavior we want to be able to enforce from config.
Related
- Background process polling wastes tokens: each write_stdin poll triggers full API turn with complete history #13733 Background process polling wastes tokens: each write_stdin poll
triggers a full API turn - exec_command yield_time_ms is ignored or capped around 30s on initial command #22541 exec_command yield_time_ms is ignored or capped around 30s on the
initial command - [Hooks] Allow PreToolUse hooks to make exec_command wait for long-running commands (waitUntilCompletion) #39596 Allow PreToolUse hooks to make exec_command wait for long-running
commands
This request is narrower than those: a config value for the minimum (or an
override) of the wait the model already controls. Processes that never exit,
such as dev servers or watchers, would still return after the configured
minimum.
Activity
LoomDeBWiles commentedon Nov 15, 2026
Adding data from six long-running GPT-6.1-Sol (high) sessions on CLI 0.165, each told in AGENTS.md to block on one long wait (
yield_time_ms86400000, whichbackground_terminal_max_timeoutallows on this host):write_stdinwith empty input 10 times at 300000 ms. That's the top of the "5000-300000 ms" range in the built-inwrite_stdindescription, which seems to override the instruction file.wait58 times at 60000 ms during a 6.5-hour run that used 113M tokens.So long waits work. The short polls come from the model's choice of yield, influenced by the default range in the tool description. A config minimum, as proposed here, would have stopped both failures. Please apply it to code-mode
wait(cell_id)as well asexec_commandandwrite_stdin, since one of the two failures went through that path.