fix(agents): an agent with several limited skills gets the largest turn limit

This commit is contained in:
Ian 2026-10-23 16:13:27 -04:00 • committed by Ahmed Allam
parent b17c0275a9
commit b8d586a39b
3 changed files with 4 additions and 4 deletions

View file

@ -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.
"""

View file

@ -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()

View file

@ -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