fix(models): delegate generic provider catalogs to Hermes CLI#1726
fix(models): delegate generic provider catalogs to Hermes CLI#1726Michaelyklam wants to merge 1 commit intonesquena:masterfrom
Conversation
SummaryPulled the branch and walked Code referenceThe new priority order on provider_cfg = cfg.get("providers", {}).get(pid, {})
raw_models = []
# User-configured model allowlists are explicit local
# source-of-truth and should still beat auto-discovery.
# Otherwise, ask Hermes CLI first so WebUI tracks the same
# live catalog as the agent/CLI picker; WebUI's static
# _PROVIDER_MODELS table is now a fallback only (#1240).
if isinstance(provider_cfg, dict) and "models" in provider_cfg:
cfg_models = provider_cfg["models"]
if isinstance(cfg_models, dict):
raw_models = [{"id": k, "label": k} for k in cfg_models.keys()]
elif isinstance(cfg_models, list):
raw_models = [{"id": k, "label": k} for k in cfg_models]
if not raw_models:
raw_models = _models_from_live_provider_ids(
pid,
_read_live_provider_model_ids(pid),
)
if not raw_models:
raw_models = copy.deepcopy(_PROVIDER_MODELS.get(pid, []))That four-tier resolution (config allowlist → CLI live → static fallback → auto-detected) reads cleanly against what each layer is authoritative for. Cross-repo agent contractThe CLI side at def provider_model_ids(provider: Optional[str], *, force_refresh: bool = False) -> list[str]:
normalized = normalize_provider(provider)
if normalized == "openrouter":
return model_ids(force_refresh=force_refresh)
if normalized == "openai-codex":
# ...uses live ChatGPT catalog endpoint with OAuth token...
return get_codex_model_ids(access_token=access_token)
if normalized in {"copilot", "copilot-acp"}:
try:
live = _fetch_github_models(_resolve_copilot_catalog_api_key())
if live:
return live
except Exception:
pass
if normalized == "nous":
# ...live Nous Portal /models endpoint...Calling that means WebUI now sees catalog updates for openrouter, codex, copilot, nous, stepfun, etc. without a WebUI release. Good cross-repo factoring. DiagnosisThree small observations:
One questionThe VerificationThe three test files cover the right cases: |
|
Thanks @Michaelyklam — this shipped in v0.51.8 (commit GitHub didn't auto-close because the merge commit only references the squash-merged stage branch, not your fork's commit directly — closing manually for hygiene. Live now on https://get-hermes.ai/ and on existing installs after Release notes: https://github.com/nesquena/hermes-webui/releases/tag/v0.51.8 |
…catalogs to Hermes CLI by @Michaelyklam
…p + test-isolation fix Constituent PRs: - nesquena#1725 (@Michaelyklam) — simplify compact Activity row summary - nesquena#1726 (@Michaelyklam) — delegate generic provider catalogs to Hermes CLI (slice of nesquena#1240) - nesquena#1727 (@Michaelyklam) — link Claude Code OAuth in onboarding (closes nesquena#1362) - nesquena#1728 (@starship-s) — preserve profile context when starting chats - nesquena#1729 (@Michaelyklam) — persist compact Activity disclosure state - nesquena#1730 (@Michaelyklam) — prevent sticky sidebar hover drag state - nesquena#1732 (@Sanjays2402) — unpin scroll on small upward motion during streaming (closes nesquena#1731) Plus 2 in-stage absorbed fixes: - test-isolation fix: monkeypatch.setattr(config, 'cfg', X) survives PR nesquena#1728's path/mtime-aware get_config() reload. Mandatory before tag (Opus stage-302). - Opus SHOULD-FIX #1: _lastScrollTop reset on session switch (nesquena#1732 follow-up). Tests: 4537 → 4584 passing (+47). 0 regressions. Full suite ~128s. Stably green. Pre-release verification: - All 7 PRs CI-green individually + rebased onto master - pytest 4584 passed, 0 failed (multiple runs) - node -c clean on all 4 modified .js files - 11/11 browser API endpoints PASS on isolated port 8789 - 20 QA tests via webui_qa_agent.sh PASS - Opus advisor: SHIP, 5/5 verification clean, 0 MUST-FIX, 1 SHOULD-FIX absorbed (_lastScrollTop reset), 1 SHOULD-FIX deferred (nesquena#1736 — _clear_anthropic_env_values race, onboarding-time-only) Closes nesquena#1362, nesquena#1731.
Thinking Path
What Changed
hermes_cli.models.provider_model_ids()._PROVIDER_MODELSentries.modelsallowlists as the highest-priority source.Refs #1240.
Why It Matters
The model picker stays aligned with the installed Hermes Agent/CLI catalog as providers evolve, while still remaining safe when CLI catalog lookup is unavailable.
Verification
test (3.11),test (3.12), andtest (3.13)are passing on commit91890abd.tests/test_issue1240_generic_cli_catalog_sync.py,tests/test_issue644.py, andtests/test_model_resolver.py.Risks / Follow-ups
Model Used
OpenAI Codex / GPT-5.5 via Hermes Agent, with terminal/file tools and maintainer-autopilot PR stewardship.