From b8d586a39bc59d0afb5c0cb9369e9fba7ab9f7d5 Mon Sep 17 00:00:00 2001 From: Ian Date: Fri, 23 Oct 2026 16:13:27 -0400 Subject: [PATCH] fix(agents): an agent with several limited skills gets the largest turn limit --- strix/core/runner.py | 2 +- strix/skills/__init__.py | 4 ++-- tests/test_skill_dir_extension.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/strix/core/runner.py b/strix/core/runner.py index 6ccb2c583..ca4c1e799 100644 --- a/strix/core/runner.py +++ b/strix/core/runner.py @@ -254,7 +254,7 @@ async def run_strix_scan( ``report_tool`` is the tool every agent files findings with, in place of ``create_vulnerability_report``. ``subagent_turn_limits`` maps a skill name to a soft turn limit for sub-agents - spawned with that skill (the smallest applies). Agents are warned 10 turns + spawned with that skill (the largest applies). Agents are warned 10 turns before it and reminded past it, but never stopped. """ diff --git a/strix/skills/__init__.py b/strix/skills/__init__.py index 514b5571d..4e421c4b5 100644 --- a/strix/skills/__init__.py +++ b/strix/skills/__init__.py @@ -271,9 +271,9 @@ def _candidate_skill_files(skill_name: str) -> list[Path]: def skill_turn_limit(skill_names: list[str], turn_limits: Mapping[str, int]) -> int | None: - """Smallest of ``turn_limits`` (keyed by skill name) among these skills, if any.""" + """Largest of ``turn_limits`` (keyed by skill name) among these skills, if any.""" files = {path for name in skill_names for path in _candidate_skill_files(name)} - return min( + return max( ( limit for name, limit in turn_limits.items() diff --git a/tests/test_skill_dir_extension.py b/tests/test_skill_dir_extension.py index 8e34cdd95..4ea18fc50 100644 --- a/tests/test_skill_dir_extension.py +++ b/tests/test_skill_dir_extension.py @@ -293,6 +293,6 @@ def test_skill_turn_limit_matches_bare_and_qualified_names(tmp_path: Path) -> No assert skill_turn_limit(["investigator"], limits) == 25 assert skill_turn_limit(["pr_review/validator", "idor"], limits) == 40 - assert skill_turn_limit(["investigator", "validator"], limits) == 25 + assert skill_turn_limit(["investigator", "validator"], limits) == 40 assert skill_turn_limit(["idor"], limits) is None assert skill_turn_limit(["investigator"], {}) is None