mirror of
https://github.com/usestrix/strix.git
synced 2026-10-06 02:48:10 +00:00
fix: stop the run after finish_pr_review (#1451)
This commit is contained in:
parent
55bc07991a
commit
03d2c6c168
2 changed files with 15 additions and 0 deletions
|
|
@ -517,6 +517,8 @@ def _lifecycle_tool_completed(tool_name: str, output: Any) -> bool:
|
|||
completion_key = "agent_completed"
|
||||
elif tool_name == "finish_scan":
|
||||
completion_key = "scan_completed"
|
||||
elif tool_name == "finish_pr_review": # registered by strix-pro
|
||||
completion_key = "review_completed"
|
||||
else:
|
||||
return False
|
||||
|
||||
|
|
|
|||
|
|
@ -128,3 +128,16 @@ def test_disabling_strict_leaves_shared_tools_untouched() -> None:
|
|||
agent = factory.build_strix_agent(is_root=True)
|
||||
|
||||
assert any(t.strict_json_schema for t in agent.tools if isinstance(t, FunctionTool))
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
("tool_name", "output", "completed"),
|
||||
[
|
||||
("finish_pr_review", '{"success": true, "review_completed": true}', True),
|
||||
("finish_pr_review", '{"success": false, "error": "agents_still_active"}', False),
|
||||
("finish_scan", '{"success": true, "scan_completed": true}', True),
|
||||
("think", '{"success": true, "review_completed": true}', False),
|
||||
],
|
||||
)
|
||||
def test_lifecycle_tool_completed(tool_name: str, output: str, completed: bool) -> None:
|
||||
assert factory._lifecycle_tool_completed(tool_name, output) is completed
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue