Files
codex/codex-rs/code-mode
pakrym-oai a7caf1bd7a Add hidden grace to code mode yields (#2054)
## Why

Code-mode `exec` and `wait` can use the same yield duration as an
awaited nested tool call. Because the outer timer starts first, it can
expire just before the nested result arrives, forcing an otherwise
unnecessary continuation and extra `wait` call.

## What changed

- Add a one-second internal grace period to code-mode `exec` and `wait`
yield timers only when the configured yield is at least 10 seconds.
- Keep the model-visible yield values, defaults, and accepted parameters
unchanged.
- Preserve exact timing for explicit short yields, including the
immediate-yield `0` case.
- Cover the 10-second threshold and nested-tool behavior through both
`exec` and `wait` with virtual-time tests instead of slow wall-clock
integration tests.

## User impact

Nested calls using the 10-second default (or a longer configured yield)
get one extra second to return through the current code-mode call
instead of needlessly yielding the outer cell. Sub-10-second yields
retain their existing timing.

## Test plan

- `just test -p codex-code-mode`
2026-07-20 18:05:00 -07:00
..
2026-03-20 23:36:58 -07:00