fix(interface): remove dead reasoning-effort branches, fix model name and STRIX_IMAGE casing

Drop the two unreachable STRIX_REASONING_EFFORT branches in
validate_environment (the var is never added to missing_optional_vars),
replace the stale anthropic/claude-opus-4-7 example with the canonical
anthropic/claude-sonnet-4-6, and correct the env-var casing in the
_resolve_sandbox_image error message to STRIX_IMAGE.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
mitnick 2026-06-26 01:50:50 +00:00 • committed by Rome-1
parent 7141ccff62
commit 84d48db6ea
3 changed files with 38 additions and 16 deletions

View file

@ -30,7 +30,8 @@ def _resolve_sandbox_image() -> str:
image = load_settings().runtime.image
if not image:
raise RuntimeError(
"strix_image is not configured. Set it in ~/.strix/cli-config.json.",
"STRIX_IMAGE is not configured. Set it via export STRIX_IMAGE=<image> "
"or in ~/.strix/cli-config.json.",
)
return image

View file

@ -105,7 +105,7 @@ def validate_environment() -> None:
error_text.append("STRIX_LLM", style="bold cyan")
error_text.append(
" - Model name to use (e.g., 'openai/gpt-5.4' or "
"'anthropic/claude-opus-4-7')\n",
"'anthropic/claude-sonnet-4-6')\n",
style="white",
)
@ -134,14 +134,6 @@ def validate_environment() -> None:
" - API key for Perplexity AI web search (enables real-time research)\n",
style="white",
)
elif var == "STRIX_REASONING_EFFORT":
error_text.append("• ", style="white")
error_text.append("STRIX_REASONING_EFFORT", style="bold cyan")
error_text.append(
" - Reasoning effort level: none, minimal, low, medium, high, xhigh "
"(default: high)\n",
style="white",
)
error_text.append("\nExample setup:\n", style="white")
error_text.append("export STRIX_LLM='openai/gpt-5.4'\n", style="dim white")
@ -164,11 +156,6 @@ def validate_environment() -> None:
error_text.append(
"export PERPLEXITY_API_KEY='your-perplexity-key-here'\n", style="dim white"
)
elif var == "STRIX_REASONING_EFFORT":
error_text.append(
"export STRIX_REASONING_EFFORT='high'\n",
style="dim white",
)
panel = Panel(
error_text,
@ -240,7 +227,7 @@ async def warm_up_llm() -> None:
)
warn_text.append("<provider>/<model>", style="bold cyan")
warn_text.append(
"' form, e.g. 'anthropic/claude-opus-4-7', 'deepseek/deepseek-v4-pro'.",
"' form, e.g. 'anthropic/claude-sonnet-4-6', 'deepseek/deepseek-v4-pro'.",
style="white",
)
console.print(
@ -310,6 +297,7 @@ def _positive_budget(value: str) -> float:
except ValueError as exc:
raise argparse.ArgumentTypeError(f"invalid float value: {value!r}") from exc
import math
if not math.isfinite(budget) or budget <= 0:
raise argparse.ArgumentTypeError("must be a finite number greater than 0")
return budget

View file

@ -0,0 +1,33 @@
"""Tests for interface message cleanups.
Covers three cosmetic-correctness fixes:
* dead ``STRIX_REASONING_EFFORT`` branches removed from ``validate_environment``;
* stale ``claude-opus-4-7`` model name replaced with ``claude-sonnet-4-6``;
* ``_resolve_sandbox_image`` reports the env var with correct ``STRIX_IMAGE`` casing.
"""
import inspect
import types
import pytest
from strix.interface import cli
from strix.interface.main import validate_environment, warm_up_llm
def test_reasoning_effort_branches_removed() -> None:
source = inspect.getsource(validate_environment)
assert "STRIX_REASONING_EFFORT" not in source
def test_model_name_uses_sonnet_recommendation() -> None:
source = inspect.getsource(validate_environment) + inspect.getsource(warm_up_llm)
assert "claude-opus-4-7" not in source
assert "claude-sonnet-4-6" in source
def test_resolve_sandbox_image_uses_correct_env_casing(monkeypatch: pytest.MonkeyPatch) -> None:
fake_settings = types.SimpleNamespace(runtime=types.SimpleNamespace(image=""))
monkeypatch.setattr(cli, "load_settings", lambda: fake_settings)
with pytest.raises(RuntimeError, match="STRIX_IMAGE"):
cli._resolve_sandbox_image()