mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-23 23:32:22 +02:00
fix(ui): complete exact approval continuation
This commit is contained in:
@@ -37,7 +37,7 @@ def _patch_common(monkeypatch):
|
||||
monkeypatch.setattr(al, "estimate_tokens", lambda *a, **k: 10, raising=False)
|
||||
|
||||
async def _fake_exec(block, *a, **k):
|
||||
return ("bash", {"output": "ok", "exit_code": 0})
|
||||
return (block.tool_type, {"output": "ok", "exit_code": 0})
|
||||
monkeypatch.setattr(al, "execute_tool_block", _fake_exec, raising=False)
|
||||
|
||||
|
||||
@@ -58,8 +58,14 @@ def _run_loop(monkeypatch, round_text, max_rounds=2):
|
||||
|
||||
def test_emits_rounds_exhausted_when_cap_hit_mid_task(monkeypatch):
|
||||
_patch_common(monkeypatch)
|
||||
# Every round returns a tool block -> never "done" -> loop exhausts the cap.
|
||||
events = _run_loop(monkeypatch, "```bash\necho hi\n```", max_rounds=2)
|
||||
# Use a system-owned interaction result so this remains a loop-control test:
|
||||
# Bash output is workspace-derived and now correctly pauses for exact user
|
||||
# approval before a later Bash call.
|
||||
events = _run_loop(
|
||||
monkeypatch,
|
||||
'```update_plan\n{"plan":"- [ ] keep going"}\n```',
|
||||
max_rounds=2,
|
||||
)
|
||||
assert any(e.get("type") == "rounds_exhausted" for e in events), events
|
||||
|
||||
|
||||
@@ -84,7 +90,11 @@ def test_emits_intent_nudge_exhausted_when_cap_is_exhausted(monkeypatch):
|
||||
def test_emits_loop_breaker_triggered_when_loop_breaker_trips(monkeypatch):
|
||||
_patch_common(monkeypatch)
|
||||
|
||||
events = _run_loop(monkeypatch, "```bash\necho hi\n```", max_rounds=6)
|
||||
events = _run_loop(
|
||||
monkeypatch,
|
||||
'```update_plan\n{"plan":"- [ ] keep going"}\n```',
|
||||
max_rounds=6,
|
||||
)
|
||||
|
||||
guard = next((e for e in events if e.get("type") == "loop_breaker_triggered"), None)
|
||||
assert guard is not None, events
|
||||
|
||||
Reference in New Issue
Block a user