fix(libsy): make tool signals readable from codex traffic - #560
Draft
ryan-lempka wants to merge 5 commits into
Draft
fix(libsy): make tool signals readable from codex traffic#560ryan-lempka wants to merge 5 commits into
ryan-lempka wants to merge 5 commits into
Conversation
Signed-off-by: Ryan Lempka <rlempka@nvidia.com>
|
Signed-off-by: Ryan Lempka <rlempka@nvidia.com>
Signed-off-by: Ryan Lempka <rlempka@nvidia.com>
Signed-off-by: Ryan Lempka <rlempka@nvidia.com>
Signed-off-by: Ryan Lempka <rlempka@nvidia.com>
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.
Background: Stage routing reads an agent's tool calls and output to pick the capable or efficient tier. Those signals were calibrated against Claude Code. Codex reports its tools differently, and three pattern matches fire on text that is not an error.
Under Codex the tier only ever moves toward capable. Replaying a recorded session through
stage_router,efficient_firstwent capable on the third request and never returned,capable_firstnever left capable.What: All in
crates/libsy/src/algorithms/util/tool_signals.rs.command_ofdecodes arguments sent as a JSON string, and acceptscommand,cmd, or an argv array. Responses sends a string, so the lookup always came back empty.exec_commandjoins the shell tools. Codex runs every shell action through it.write_text(,writelines(,.write(join the bash write patterns. Codex edits by piping a Python snippet to an interpreter.reports_no_failureskips severity scoring when a tool result reports exit 0, or reports the command is still running. Opening a file containing "out of memory" scored as a critical failure, and a streaming chunk echoing a diff scored on whatever that diff contained. Neither is an error the agent hit.contains_failure_literalstopserror:matching the patherror::.libsyhas a module namederror, so passing tests printtest error::tests::...and a greencargo testwas never seen as green.Why: The first three make Codex traffic legible. Before them, zero of 39 real
exec_commandcalls registered as an edit or write.The last two are not Codex-specific and matter more. Any agent that reads or writes source code can trip the severity match, and any repo with an
errormodule breaks pass detection. Both fail silently: 200s all the way, the cheap tier just stops being used.Related to #264. Scorer confidence topped out at 0.46 against the 0.5 default, so the tests-passed shortcut was the only route down, and these bugs broke exactly that. Thresholds alone would not have fixed it.
Verified by replaying recorded Codex sessions through a live server: on a passing test run the tier now moves capable to efficient, where before it could not. No claim here about turns or cost, run-to-run variance across a handful of live Codex runs was larger than any difference between routes.
Five tests, each fails without its fix.