app-server capReached reports true when output exactly equals outputBytesCap
Open 💬 0 comments Opened May 12, 2026 by mturac
I found a small edge case in app-server output cap handling.
When output length is exactly equal to outputBytesCap, capReached can be reported as true even though no output was actually truncated.
I tested three cases locally:
- below cap ->
capReached = false - exactly at cap ->
capReached = false - above cap ->
capReached = true
The narrow fix is to derive capReached from whether the original chunk was actually shortened, rather than whether the observed byte count equals the cap.
I have a small local patch covering both command/exec and process/spawn if maintainers think this matches the intended protocol semantics.
Patch branch:
https://github.com/mturac/codex/tree/audit/cap-reached-exact-cap
Commit:
https://github.com/mturac/codex/commit/956b2a8950264c41c25281583fea7746c793d8fb