mirror of
https://github.com/usestrix/strix.git
synced 2026-11-01 07:02:32 +00:00
fix(agents): an agent with several limited skills gets the largest turn limit
This commit is contained in:
parent
b17c0275a9
commit
b8d586a39b
3 changed files with 4 additions and 4 deletions
|
|
@ -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.
|
||||
"""
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue