mirror of
https://github.com/usestrix/strix.git
synced 2026-08-21 02:45:31 +02:00
fix(tui): show the actual subscription provider in the Go TUI
The Go TUI rewrite hardcoded "ChatGPT subscription" in the stats view and its snapshot only carried a boolean, so a Grok run was labeled ChatGPT — the same bug previously fixed on the Python side. Carry the provider label through the snapshot protocol and render it, falling back to a generic "Subscription". utils._subscription_label becomes public subscription_label since the TUI backend now needs it too.
This commit is contained in:
@@ -110,6 +110,28 @@ def test_state_populates_model_warning_for_non_frontier_model() -> None:
|
||||
assert "not a recommended frontier model" in warning
|
||||
|
||||
|
||||
def test_snapshot_carries_the_subscription_provider_label() -> None:
|
||||
os.environ["STRIX_LLM"] = "grok/grok-4"
|
||||
loader._cached = None
|
||||
|
||||
snapshot = TuiController(args()).snapshot()
|
||||
|
||||
# The TUI renders this label, so it must name the actual provider rather
|
||||
# than assuming ChatGPT.
|
||||
assert snapshot["subscription"] is True
|
||||
assert snapshot["subscription_label"] == "Grok subscription"
|
||||
|
||||
|
||||
def test_snapshot_has_no_subscription_label_for_api_key_runs() -> None:
|
||||
os.environ["STRIX_LLM"] = "openai/gpt-5.4"
|
||||
loader._cached = None
|
||||
|
||||
snapshot = TuiController(args()).snapshot()
|
||||
|
||||
assert snapshot["subscription"] is False
|
||||
assert snapshot["subscription_label"] == ""
|
||||
|
||||
|
||||
def test_setup_restores_prepared_cli_targets() -> None:
|
||||
setup_args = args()
|
||||
setup_args.targets_info = [
|
||||
|
||||
Reference in New Issue
Block a user