refactor: collapse dual stat buckets, prune unused params, kill dead helpers

Tracer:
- Collapse the ``live`` / ``completed`` LLM stat buckets into one
  flat dict. The ``completed`` bucket was only ever written by tests
  — production never moved stats across, and ``get_total_llm_stats``
  always summed both for display.
- Drop ``record_llm_usage(agent_id=...)``: argument was unused, and
  the per-call ``bucket=`` knob is gone with the buckets.

run_config_factory:
- Drop unused ``parallel_tool_calls``, ``tool_choice`` parameters
  from ``make_run_config`` — no caller ever overrode them.
- Drop ``agent_name`` from ``make_agent_context`` — set into the
  context dict but no consumer ever read it; the bus's ``names`` map
  is the source of truth.

Wire reasoning_effort through:
- ``Config.get("strix_reasoning_effort")`` is now actually plumbed
  to ``make_run_config`` from ``entry.py``. Previously the env var
  was advertised but never consumed.

Multi-agent graph tools:
- Replace six copies of
  ``inner = ctx.context if isinstance(ctx.context, dict) else {}``
  with a single ``_ctx(ctx)`` helper.

Todo tools:
- Lift the duplicated ``priority_order`` / ``status_order`` dicts
  to module-level ``_PRIORITY_RANK`` / ``_STATUS_RANK`` and replace
  both inline sort lambdas with ``_todo_sort_key``.

Notes tools:
- Delete ``append_note_content`` (and its test): docstring claimed
  it was for an "agents-graph wiki-update hook on agent_finish" that
  was never wired up. Pure dead public API.

Style:
- Drop the ``del ctx`` no-ops from notes / reporting / web_search
  tools. ``ARG001`` is already silenced project-wide for tool
  modules; the ``del`` was cargo-culted.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
0xallam
2026-04-25 12:44:48 -07:00
parent f08ad2a634
commit d959fe2163
13 changed files with 76 additions and 198 deletions
+2 -11
View File
@@ -69,8 +69,6 @@ def make_run_config(
*,
sandbox_session: BaseSandboxSession | None,
model: str = "anthropic/claude-sonnet-4-6",
parallel_tool_calls: bool = _PARALLEL_TOOL_CALLS_DEFAULT,
tool_choice: Literal["auto", "required", "none"] | None = "required",
reasoning_effort: Literal["low", "medium", "high"] | None = None,
model_settings_override: ModelSettings | None = None,
sandbox_client: Any | None = None,
@@ -88,9 +86,6 @@ def make_run_config(
for unit tests and dry runs.
model: Model alias passed to ``MultiProvider``. Defaults to the
production Anthropic alias.
parallel_tool_calls: Default ``False`` — the tool server
serializes one task per agent.
tool_choice: Forces tool use per turn unless explicitly relaxed.
reasoning_effort: ``"low" | "medium" | "high"``; routes to
``ModelSettings.reasoning``.
model_settings_override: Optional per-run ``ModelSettings``
@@ -100,8 +95,8 @@ def make_run_config(
supplied without a client.
"""
base_settings = ModelSettings(
parallel_tool_calls=parallel_tool_calls,
tool_choice=tool_choice,
parallel_tool_calls=_PARALLEL_TOOL_CALLS_DEFAULT,
tool_choice="required",
retry=ModelRetrySettings(
max_retries=_DEFAULT_MAX_RETRIES,
backoff=_DEFAULT_BACKOFF,
@@ -113,8 +108,6 @@ def make_run_config(
ModelSettings(reasoning=Reasoning(effort=reasoning_effort)),
)
if model_settings_override is not None:
# ``ModelSettings.resolve`` merges another ModelSettings into self
# with override-wins semantics — exactly what we want.
base_settings = base_settings.resolve(model_settings_override)
sandbox_config = (
@@ -142,7 +135,6 @@ def make_agent_context(
tool_server_host_port: int | None,
caido_host_port: int | None,
agent_id: str,
agent_name: str,
parent_id: str | None,
tracer: Any | None,
model: str = "anthropic/claude-sonnet-4-6",
@@ -175,7 +167,6 @@ def make_agent_context(
"caido_host_port": caido_host_port,
"caido_capability": caido_capability,
"agent_id": agent_id,
"agent_name": agent_name,
"parent_id": parent_id,
"tracer": tracer,
"model": model,