Files
codex/codex-rs
T
Ahmed Ibrahim 0a3ad4c4ba [codex] Test code-mode variable truncation (#28471)
## Summary

Code mode has two separate truncation points: the nested tool result
returned to JavaScript and the code-mode output later recorded for the
model. These tests now verify those behaviors independently.

- Report whether `result.output` was truncated before printing it.
- Verify omitted or sufficiently large nested limits produce `Variable
truncated: False`, while allowing the printed value to be truncated
downstream.
- Verify an explicit nested limit produces `Variable truncated: True`
when the command output exceeds it.
- Use a token-policy model fixture so downstream truncation is visible
as `…N tokens truncated…`.
- Align the explicit nested-truncation expectation with the warning
header.

This PR changes test coverage only; runtime truncation behavior is
unchanged.

## Validation

- `env -u CODEX_SANDBOX_NETWORK_DISABLED RUST_MIN_STACK=8388608 cargo
test -p codex-core --test all code_mode_exec -- --nocapture` (8 passed)
0a3ad4c4ba · 2026-06-16 20:14:23 -07:00
History
..
2026-04-24 17:49:29 -07:00
2026-06-04 09:16:03 -07:00