Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions hermes_cli/moa_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,24 @@ def _prompt_choice(title: str, rows: list[str], default: int = 0) -> int:
def _model_options() -> list[dict[str, Any]]:
payload = build_models_payload(
load_picker_context(),
include_unconfigured=True,
# Slot pickers must only offer providers the user can actually call.
# Including setup-only rows makes an unconfigured canonical provider
# (usually OpenRouter, due to catalog ordering) become the default.
include_unconfigured=False,
picker_hints=True,
canonical_order=True,
pricing=True,
capabilities=True,
max_models=200,
)
providers = payload.get("providers") or []
return [p for p in providers if p.get("slug") and p.get("models")]
return [
p
for p in providers
if p.get("slug")
and str(p.get("slug")).strip().lower() != "moa"
and p.get("models")
]


def _pick_slot(current: dict[str, str] | None = None) -> dict[str, str]:
Expand Down
21 changes: 21 additions & 0 deletions tests/hermes_cli/test_moa_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,27 @@
)


def test_moa_slot_picker_excludes_unconfigured_providers(monkeypatch):
from hermes_cli import moa_cmd

captured = {}
monkeypatch.setattr(moa_cmd, "load_picker_context", lambda: object())

def fake_build(_context, **kwargs):
captured.update(kwargs)
return {
"providers": [
{"slug": "moa", "models": ["default"]},
{"slug": "opencode-go", "models": ["deepseek-v4-pro"]},
]
}

monkeypatch.setattr(moa_cmd, "build_models_payload", fake_build)

assert [row["slug"] for row in moa_cmd._model_options()] == ["opencode-go"]
assert captured["include_unconfigured"] is False


def test_normalize_moa_config_uses_default_named_preset():
cfg = normalize_moa_config({})

Expand Down