chore: import upstream snapshot with attribution
Deploy Site / deploy-vercel (push) Has been skipped
Deploy Site / deploy-docs (push) Has been skipped
Build Skills Index / build-index (push) Has been skipped
CI / Deny unrelated histories (push) Has been skipped
CI / Detect affected areas (push) Successful in 27m35s
CI / OSV scan (push) Failing after 4s
CI / Build&Test Docker image (push) Successful in 9s
CI / Supply-chain scan (push) Has been skipped
CI / Lint Docker scripts (push) Failing after 5m13s
CI / Check contributors (push) Failing after 12m8s
CI / Docs Site (push) Failing after 12m8s
CI / TypeScript (push) Failing after 12m8s
CI / Python lints (push) Failing after 12m9s
CI / Python tests (push) Failing after 12m9s
CI / Check uv.lock (push) Failing after 23m22s
CI / CI timing report (push) Has been cancelled
Build Skills Index / trigger-deploy (push) Has been cancelled
CI / All required checks pass (push) Has been cancelled
Deploy Site / deploy-vercel (push) Has been skipped
Deploy Site / deploy-docs (push) Has been skipped
Build Skills Index / build-index (push) Has been skipped
CI / Deny unrelated histories (push) Has been skipped
CI / Detect affected areas (push) Successful in 27m35s
CI / OSV scan (push) Failing after 4s
CI / Build&Test Docker image (push) Successful in 9s
CI / Supply-chain scan (push) Has been skipped
CI / Lint Docker scripts (push) Failing after 5m13s
CI / Check contributors (push) Failing after 12m8s
CI / Docs Site (push) Failing after 12m8s
CI / TypeScript (push) Failing after 12m8s
CI / Python lints (push) Failing after 12m9s
CI / Python tests (push) Failing after 12m9s
CI / Check uv.lock (push) Failing after 23m22s
CI / CI timing report (push) Has been cancelled
Build Skills Index / trigger-deploy (push) Has been cancelled
CI / All required checks pass (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
"""Regression tests for OpenCode Zen model picker limits."""
|
||||
|
||||
import os
|
||||
from unittest.mock import patch
|
||||
|
||||
import hermes_cli.providers as providers_mod
|
||||
from hermes_cli.model_switch import list_authenticated_providers
|
||||
|
||||
|
||||
def test_opencode_zen_lists_all_models_while_other_providers_remain_capped(monkeypatch):
|
||||
"""OpenCode Zen is an aggregator product, so the picker must expose its full catalog."""
|
||||
zen_models = [f"zen-model-{i}" for i in range(57)]
|
||||
deepseek_models = [f"deepseek-model-{i}" for i in range(57)]
|
||||
|
||||
monkeypatch.setattr(
|
||||
"agent.models_dev.PROVIDER_TO_MODELS_DEV",
|
||||
{
|
||||
"opencode-zen": "opencode",
|
||||
"deepseek": "deepseek",
|
||||
},
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
"agent.models_dev.fetch_models_dev",
|
||||
lambda: {"opencode": {}, "deepseek": {}},
|
||||
)
|
||||
monkeypatch.setattr(providers_mod, "HERMES_OVERLAYS", {})
|
||||
monkeypatch.setattr(
|
||||
"hermes_cli.models.cached_provider_model_ids",
|
||||
lambda provider: {
|
||||
"opencode-zen": zen_models,
|
||||
"deepseek": deepseek_models,
|
||||
}.get(provider, []),
|
||||
)
|
||||
|
||||
with patch.dict(
|
||||
os.environ,
|
||||
{
|
||||
"OPENCODE_ZEN_API_KEY": "test-zen-key",
|
||||
"DEEPSEEK_API_KEY": "test-deepseek-key",
|
||||
},
|
||||
clear=False,
|
||||
):
|
||||
providers = list_authenticated_providers(max_models=50)
|
||||
|
||||
opencode_zen = next(p for p in providers if p["slug"] == "opencode-zen")
|
||||
deepseek = next(p for p in providers if p["slug"] == "deepseek")
|
||||
|
||||
assert opencode_zen["models"] == zen_models
|
||||
assert opencode_zen["total_models"] == len(zen_models)
|
||||
assert deepseek["models"] == deepseek_models[:50]
|
||||
assert deepseek["total_models"] == len(deepseek_models)
|
||||
Reference in New Issue
Block a user