fix: preserve current approval semantics for tirith guard
Restore gateway/run.py to current main behavior while keeping tirith startup and pattern_keys replay, preserve yolo and non-interactive bypass semantics in the combined guard, and add regression tests for yolo and view-full flows.
This commit is contained in:
parent
375ce8a881
commit
6f1889b0fa
5 changed files with 1959 additions and 13 deletions
|
|
@ -377,6 +377,18 @@ class TestViewFullCommand:
|
|||
result = prompt_dangerous_approval(long_cmd, "recursive delete")
|
||||
assert result == "always"
|
||||
|
||||
def test_view_then_session_when_permanent_hidden(self):
|
||||
"""The view-full flow still works when allow_permanent=False."""
|
||||
long_cmd = "rm -rf " + "d" * 200
|
||||
inputs = iter(["v", "s"])
|
||||
with mock_patch("builtins.input", side_effect=inputs):
|
||||
result = prompt_dangerous_approval(
|
||||
long_cmd,
|
||||
"recursive delete",
|
||||
allow_permanent=False,
|
||||
)
|
||||
assert result == "session"
|
||||
|
||||
def test_view_not_shown_for_short_command(self):
|
||||
"""Short commands don't offer the view option; 'v' falls through to deny."""
|
||||
short_cmd = "rm -rf /tmp"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue