Repository navigation
fix(stage-router): don't let an exit line inside a read file fail the read - #964
Open
harshitwandhare wants to merge 2 commits into
Open
harshitwandhare wants to merge 2 commits into
harshitwandhare wants to merge 2 commits into
Conversation
Contributor
Signed-off-by: Harshit Wandhare <harshitwandhare45@gmail.com>
harshitwandhare
force-pushed
the
fix/codex-read-exit-status
branch
from
October 11, 2026 01:59
6a5608a to
df7b35f
Compare
Signed-off-by: Harshit Wandhare <harshitwandhare45@gmail.com>
Author
|
Pushed The new test |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#906 stops error text inside a file read from counting as a failure. A read still counts when the read itself failed. Deciding that ran
has_nonzero_exit_statusover the whole result, including the content that was read. So a log with an exit line in it turns the read back into a failure, and then every error pattern in the log counts as well. This happens for Codexexec_commandresults and for Hermesterminalresults.Measured on
mainatfc64565awith a probe test that printsToolSignals::from_request(..).severity:cat run.logProcess exited with code 0headercat run.logProcess exited with code 1tail -n 20 test.loggo testfailure log that containsexit status 1cat run.log"exit_code": 0cat run.logProcess exited with code 1tail -n 20 test.loggo testlog withexit status 1A failing test run started with plain
go test, no package arguments, printsexit status 1.go test ./...andgo test .leave that line out. So reading a log saved from a plaingo testrun is enough to hit this.Fix
Hermes puts the status in
exit_code, which #949 already reads. Codex puts it in a header beforeOutput:, the shape this file's tests already use. For a read, the status now comes from the Hermes fields when the result has them, otherwise from the Codex header. A result with neither is scanned whole, as before.Verified
codex_read_status_comes_from_the_headerfails onmainwithleft: 1.0, right: 0.0and passes with the fix. It also checks that a read whose header sayscode 1still counts.hermes_read_status_comes_from_exit_codefails ondf7b35f8(the Codex commit alone) withleft: 1.0, right: 0.0and passes at59567134. It also checks that"exit_code": 1still counts.cargo test -p switchyard-libsy --lib tool_signals: 80 passed at59567134.cargo test --workspace --lockedat59567134: 962 passed, 0 failed over 40 binaries. Prefill-router tests 68 / 0.cargo fmt --all --checkand both clippy runs with-D warningsare clean. Rust only, so the Python gates were not re-run."exit_code": 1) still score 1.0 and 0.3 as onmain.Not changed
Results from the
Bashtool have neither, so the samecat run.logthroughBashstill scores 1.0. This file's tests model a failedBashread withis_error, so the text scan may not be needed there. I don't know whether every harness without a status field setsis_error, so I left that case alone. I can follow up if you want it handled.