Strip model-aware branches from LLM configuration

Drop every hand-rolled provider table and per-model gating that had
accumulated in the model-handling layer:

  * normalize_model_name no longer auto-prefixes bare claude-* / gemini-*
    names. Users supply the full <provider>/<model> form. The function
    became literally model_name.strip(), so callers now inline that and
    the function is removed.
  * tool_choice="required" is gone everywhere. Thinking-mode endpoints
    (Anthropic, DeepSeek /beta) reject it; modern reasoning models don't
    need it; non-interactive runs already have
    _append_noninteractive_tool_required_message as the convergence
    backstop. model_supports_reasoning, model_known_to_registry, and
    _model_cost_entry were only used to gate this and follow it out.
  * Reasoning(effort=...) is now attached whenever
    STRIX_REASONING_EFFORT is non-none. litellm.drop_params=True absorbs
    it for non-reasoning models.
  * Warm-up's bare-name OpenAI 401 hint is removed (false-positive prone,
    relied on substring matching).
  * reset_tool_choice on SandboxAgent is no-op now (no tool_choice gets
    set) and is removed.
  * report/dedupe.py was still routing through stock MultiProvider, so
    non-OpenAI configs failed the dedupe LLM pass; switch it to
    StrixProvider.

Verified end-to-end against modern provider strings (openai/gpt-5.4,
anthropic/claude-opus-4-7, deepseek/deepseek-reasoner,
gemini/gemini-2.5-pro, groq/, xai/, mistral/, together_ai/, perplexity/,
openrouter/, litellm/ legacy form, and whitespace-padded input): 18/18
cases route correctly, env vars mirror via litellm.validate_environment,
and ModelSettings carries no tool_choice. mypy strict passes.
This commit is contained in:
0xallam
2026-06-07 17:36:19 -07:00
committed by Ahmed Allam
parent 232711be8c
commit 3665a7899f
6 changed files with 13 additions and 105 deletions
+3 -22
View File
@@ -5,7 +5,6 @@ Strix Agent Interface
import argparse
import asyncio
import contextlib
import shutil
import sys
from datetime import UTC, datetime
@@ -23,7 +22,7 @@ from strix.config import (
load_settings,
persist_current,
)
from strix.config.models import StrixProvider, configure_sdk_model_defaults, normalize_model_name
from strix.config.models import StrixProvider, configure_sdk_model_defaults
from strix.core.paths import run_dir_for, runtime_state_dir
from strix.interface.cli import run_cli
from strix.interface.tui import run_tui
@@ -216,7 +215,7 @@ async def warm_up_llm() -> None:
configure_sdk_model_defaults(settings)
llm = settings.llm
model = StrixProvider().get_model(normalize_model_name(llm.model or ""))
model = StrixProvider().get_model((llm.model or "").strip())
await asyncio.wait_for(
model.get_response(
system_instructions="You are a helpful assistant.",
@@ -232,7 +231,7 @@ async def warm_up_llm() -> None:
),
timeout=llm.timeout,
)
logger.info("LLM warm-up succeeded for model %s", normalize_model_name(llm.model or ""))
logger.info("LLM warm-up succeeded for model %s", (llm.model or "").strip())
except Exception as e:
logger.exception("LLM warm-up failed")
@@ -243,24 +242,6 @@ async def warm_up_llm() -> None:
error_text.append("Please check your configuration and try again.\n", style="white")
error_text.append(f"\nError: {e}", style="dim white")
raw_model = ""
resolved = ""
with contextlib.suppress(Exception):
raw_model = (load_settings().llm.model or "").strip()
resolved = normalize_model_name(raw_model)
err_lc = str(e).lower()
unprefixed = bool(resolved) and "/" not in resolved
looks_openai = "platform.openai.com" in err_lc or "openai" in err_lc
if unprefixed and looks_openai:
error_text.append(
f"\n\nHint: '{raw_model}' has no provider prefix, so the SDK "
f"routed it through OpenAI by default. For non-OpenAI providers "
f"use the '<provider>/<model>' form, e.g. "
f"'anthropic/claude-opus-4-7', 'deepseek/deepseek-reasoner', "
f"'openai/gpt-5.4'.",
style="yellow",
)
panel = Panel(
error_text,
title="[bold white]STRIX",