refactor: lift hardcoded model default + fix stale `is_whitebox` docstring
``"anthropic/claude-sonnet-4-6"`` was duplicated as a kwarg default in
5 places (``run_strix_scan``, ``make_run_config``, ``make_agent_context``,
and twice in ``agents_graph.create_agent``'s ``inner.get(..., default)``
calls). The default was actually dead code: ``validate_environment``
requires ``STRIX_LLM`` to be set before any scan starts, and the CLI/TUI
callers don't pass ``model=`` themselves.
Replaced with a single resolution in ``run_strix_scan``:
resolved_model = model or load_settings().llm.model
if not resolved_model:
raise RuntimeError("No LLM model configured. ...")
then propagated explicitly to ``make_agent_context`` and
``make_run_config``. Both lose their string defaults — ``model`` is now
a required kwarg. The graph tool's ``inner.get("model", "...")`` is
``inner["model"]``: the parent context guarantees it's set.
Drive-by: ``run_strix_scan`` docstring still listed ``is_whitebox`` as
a ``scan_config`` key — stale since ``1e641e5`` derived it from
``targets`` instead. Updated.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -446,7 +446,7 @@ async def create_agent(
|
||||
agent_id=child_id,
|
||||
parent_id=parent_id,
|
||||
tracer=inner.get("tracer"),
|
||||
model=inner.get("model", "anthropic/claude-sonnet-4-6"),
|
||||
model=inner["model"],
|
||||
model_settings=inner.get("model_settings"),
|
||||
max_turns=int(inner.get("max_turns", 300)),
|
||||
is_whitebox=bool(inner.get("is_whitebox", False)),
|
||||
@@ -458,7 +458,7 @@ async def create_agent(
|
||||
child_run_config = make_run_config(
|
||||
sandbox_session=inner.get("sandbox_session"),
|
||||
sandbox_client=inner.get("sandbox_client"),
|
||||
model=inner.get("model", "anthropic/claude-sonnet-4-6"),
|
||||
model=inner["model"],
|
||||
model_settings_override=inner.get("model_settings"),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user