feat: add STRIX_DISABLE_FIX_AGENTS to skip dedicated fix subagents#602
feat: add STRIX_DISABLE_FIX_AGENTS to skip dedicated fix subagents#6020xfelixli wants to merge 1 commit into
Conversation
When set, the root coordinator is instructed not to spawn dedicated fix/remediation subagents; remediation still lands in each report's remediation_steps field. Off by default, so existing behavior is unchanged. Useful for cost-conscious scans where a separate fix-writing agent mostly burns tokens and concurrency. The directive is injected into the root agent's prompt only when the env var is set and only for the root agent, leaving child prompts and the shipped skill file untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR introduces an opt-in
Confidence Score: 4/5Safe to merge — the flag is off by default and all three changed files make purely additive changes with no impact on existing behaviour. The implementation is small, focused, and consistent with existing patterns. The one note-worthy edge case — load_settings() being called inside render_system_prompt's exception-swallowing block — could obscure config errors in the rare scenario where settings are loaded for the first time on this path, but the practical risk is low given memoisation. strix/agents/prompt.py — the new load_settings() call sits inside the broad exception handler; worth a quick look if the flag ever appears not to take effect. Important Files Changed
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
strix/agents/prompt.py:99-104
**Settings failure silently disables the flag**
`load_settings()` is called here for the first time on this code path inside the function's broad `try/except Exception` block. If settings initialisation raises on that first call (e.g. a pydantic `ValidationError` from an unexpected env value), the exception is caught, logged only as `"render_system_prompt failed; returning empty prompt"`, and the root agent gets an empty system prompt — with no indication that `STRIX_DISABLE_FIX_AGENTS` was involved. In practice `load_settings()` is memoized and is almost certainly already warm before this point, but calling it outside the try block (or at least asserting `_cached is not None` before entering it) would make failure attribution clearer.
Reviews (1): Last reviewed commit: "feat: add STRIX_DISABLE_FIX_AGENTS to sk..." | Re-trigger Greptile |
| if ( | ||
| is_root | ||
| and "root_agent" in skill_content | ||
| and load_settings().agents.disable_fix_agents | ||
| ): | ||
| skill_content["root_agent"] += _DISABLE_FIX_AGENTS_DIRECTIVE |
There was a problem hiding this comment.
Settings failure silently disables the flag
load_settings() is called here for the first time on this code path inside the function's broad try/except Exception block. If settings initialisation raises on that first call (e.g. a pydantic ValidationError from an unexpected env value), the exception is caught, logged only as "render_system_prompt failed; returning empty prompt", and the root agent gets an empty system prompt — with no indication that STRIX_DISABLE_FIX_AGENTS was involved. In practice load_settings() is memoized and is almost certainly already warm before this point, but calling it outside the try block (or at least asserting _cached is not None before entering it) would make failure attribution clearer.
Prompt To Fix With AI
This is a comment left during a code review.
Path: strix/agents/prompt.py
Line: 99-104
Comment:
**Settings failure silently disables the flag**
`load_settings()` is called here for the first time on this code path inside the function's broad `try/except Exception` block. If settings initialisation raises on that first call (e.g. a pydantic `ValidationError` from an unexpected env value), the exception is caught, logged only as `"render_system_prompt failed; returning empty prompt"`, and the root agent gets an empty system prompt — with no indication that `STRIX_DISABLE_FIX_AGENTS` was involved. In practice `load_settings()` is memoized and is almost certainly already warm before this point, but calling it outside the try block (or at least asserting `_cached is not None` before entering it) would make failure attribution clearer.
How can I resolve this? If you propose a fix, please make it concise.
What
Adds an opt-in env flag,
STRIX_DISABLE_FIX_AGENTS(defaultfalse), that tells the root coordinator not to spawn dedicated fix/remediation subagents.Why
On large scans the coordinator routinely spawns a separate "… Fixing Agent" per confirmed finding. For cost-conscious runs that just want findings + reports, those extra agents mostly burn tokens and concurrency: remediation is already required and captured inline in each report's
remediation_steps.How
AgentSettings.disable_fix_agents(STRIX_DISABLE_FIX_AGENTS), re-exported fromstrix.configlike the other settings sub-models.Prompt-level directive (soft constraint), not a tool-level block; happy to add hard enforcement at the spawn tool if preferred.
🤖 Generated with Claude Code