Treat grep no matches as nonfatal
This commit is contained in:
@@ -112,6 +112,23 @@ def test_shell_exec_allows_safe_command(tmp_path: Path) -> None:
|
||||
assert str(tmp_path) in result["result"]["output"]
|
||||
|
||||
|
||||
def test_shell_exec_treats_grep_no_matches_as_information(tmp_path: Path) -> None:
|
||||
_write_config_tree(tmp_path)
|
||||
controller = RuntimeController(base_dir=tmp_path)
|
||||
result = controller.handle_task(
|
||||
UserTask(
|
||||
input="run grep with no matches",
|
||||
context={
|
||||
"requested_tool": "shell_exec",
|
||||
"tool_args": {"command": "printf 'abc\\n' | grep definitely_missing"},
|
||||
},
|
||||
)
|
||||
)
|
||||
assert result["status"] == "completed"
|
||||
assert result["result"]["metadata"]["exit_code"] == 1
|
||||
assert result["result"]["metadata"]["no_matches"] is True
|
||||
|
||||
|
||||
def test_permission_resolution_can_resume_task(tmp_path: Path) -> None:
|
||||
_write_config_tree(tmp_path)
|
||||
controller = RuntimeController(base_dir=tmp_path)
|
||||
|
||||
Reference in New Issue
Block a user