From 84d48db6eaf0071cc7b657bad983c1f5601f8c69 Mon Sep 17 00:00:00 2001 From: mitnick Date: Fri, 26 Jun 2026 01:50:50 +0000 Subject: [PATCH] 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 --- strix/interface/cli.py | 3 ++- strix/interface/main.py | 18 +++-------------- tests/test_interface_messages.py | 33 ++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 16 deletions(-) create mode 100644 tests/test_interface_messages.py diff --git a/strix/interface/cli.py b/strix/interface/cli.py index f5079120..2be612c1 100644 --- a/strix/interface/cli.py +++ b/strix/interface/cli.py @@ -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= " + "or in ~/.strix/cli-config.json.", ) return image diff --git a/strix/interface/main.py b/strix/interface/main.py index 4eae0527..72712ef4 100644 --- a/strix/interface/main.py +++ b/strix/interface/main.py @@ -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("/", 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 diff --git a/tests/test_interface_messages.py b/tests/test_interface_messages.py new file mode 100644 index 00000000..b074634f --- /dev/null +++ b/tests/test_interface_messages.py @@ -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()