fix(interpreter): handle command not found like bash#61
Merged
Conversation
Return exit code 127 and stderr message matching bash format
("bash: cmd: command not found") instead of a Rust error.
This allows scripts to continue execution after missing commands.
https://claude.ai/code/session_01B8T58ASprjpcgJQkgb3qG9
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
- Add 12 test cases for command not found behavior - Update existing tests to use unwrap() and check exit 127 - Add spec test file for bash compatibility comparison - Update threat model spec with bash-compatible behavior - Update test count in threat model doc (39 -> 51) https://claude.ai/code/session_01B8T58ASprjpcgJQkgb3qG9
afc7f0a to
6d4e982
Compare
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.
Summary
ssh,du) with bash-compatible behavior instead of raising a Rust errorbash: <cmd>: command not foundset -e)Changes
Core fix (
crates/bashkit/src/interpreter/mod.rs)Err(Error::CommandNotFound)toOk(ExecResult::err(..., 127))bash: <cmd>: command not foundTests (
crates/bashkit/tests/threat_model_tests.rs).unwrap()and check exit code 127Spec test (
crates/bashkit/tests/spec_cases/bash/command-not-found.test.sh)Documentation (
specs/006-threat-model.md)Test plan
https://claude.ai/code/session_01B8T58ASprjpcgJQkgb3qG9