Expand description
Result conventions of the model’s bash (wave 38, from Mirror’s tools/bash_tool.rs):
- exit code 1 from a read-only comparison command (
grep,rg,diff,cmp,test, …) reports a result, not a failure. When the command is a simple pipeline whose last command is one of those, the result carries anexit_note(“No matches found”); runtime.py then shows[No matches found (exit code 1)]instead of the failure line[exit code 1].exit_codestays 1 (and.ok, a clean exit 0, stays false); - a failed command whose output shows the sandbox refused it carries a
sandbox_note(sandbox::refusal), a line runtime.py prints after the output, saying what was blocked and what is allowed.
Constants§
- NON_
ERROR_ EXIT_ 1 - Commands whose exit code 1 reports a result, and the note shown in place of the failure line.
Functions§
- annotate
- Adds the notes to a
bashresult (output) or a job snapshot (text) ofcommand:exit_notewhen the command ended with a non-error exit 1,sandbox_notewhen it failed andpolicy(the sandbox in use, if any) refused it. A result still running, stopped or without an exit code gets neither. - exit_
note - The note for
exit_codeofcommand: exit code 1 of a simple pipeline (commands joined by|or|&, nothing else) whose last command is one ofNON_ERROR_EXIT_1. Anything else (;,&&,||,&, a newline, a subshell or command substitution, a!negation) may have taken its status from another command: no note.