Skip to content

fix(models): opencode aggregator picker catalog + uncap + scoped live-first; clear stale gateway base_url - #53977

Merged
teknium1 merged 5 commits into
mainfrom
hermes/hermes-7223fc5c
Jun 28, 2026
Merged

teknium1 merged 5 commits into
mainfrom
hermes/hermes-7223fc5c

Conversation

@teknium1

Copy link
Copy Markdown
Collaborator

Summary

Two salvaged fixes for the OpenCode Zen / Go model picker, both surfaced by a Discord /model report where opencode/nemotron-3-ultra-free was missing from the dropdown and a typed switch failed against a stale build.

What was salvaged + corrected

The original #49129 made the live-first merge unconditional in the shared provider_model_ids() profile branch — which regressed curated-first for single providers (kimi/zai, #46309) and encoded that regression by flipping the existing kimi-coding and zai test assertions to expect live-first. Salvage scopes live-first to an explicit _LIVE_FIRST_PICKER_PROVIDERS = {opencode-zen, opencode-go}; every other provider keeps curated-first. The uncapped-picker and live-first sets were both widened to opencode-go, which has the same large-catalog problem.

The #51488 change is correct as-is: built-in providers resolve their endpoint from the provider profile, so popping the stock/stale inline base_url for non-custom providers is the right behavior; custom endpoints keep their base_url (guarded by the != "custom" check). clear_base_url is opt-in (default False), so no other caller changes behavior.

Discord's 25-option select-menu limit is a hard API constraint; the adapter already shows "N more available — type /model <name> directly". A pagination/autocomplete UI is a separate follow-up, not in this PR.

Changes

  • hermes_cli/models.py: refreshed opencode-zen curated catalog; per-provider merge order via _LIVE_FIRST_PICKER_PROVIDERS.
  • hermes_cli/model_switch.py: _UNCAPPED_PICKER_PROVIDERS = {opencode-zen, opencode-go}.
  • hermes_cli/config.py: opt-in clear_base_url on clear_model_endpoint_credentials().
  • gateway/slash_commands.py: clear stale inline base_url for non-custom providers on gateway model-switch persistence.
  • Tests: per-provider merge-order contract; restored kimi-coding curated-first assertion; opencode-zen uncap + gateway base_url-persist guards.
  • scripts/release.py: AUTHOR_MAP entries for both contributors.

Validation

Before After
opencode/nemotron-3-ultra-free in picker absent (stale catalog) present
OpenCode aggregator picker capped at 25 full catalog
kimi/zai merge order curated-first curated-first (preserved)
opencode-zen/-go merge order curated-first live-first
gateway switch to built-in w/ stale base_url stale endpoint persisted inline base_url cleared
custom-endpoint base_url kept kept

Targeted tests: 27 passed (model catalog, live/curated merge, uncap, models.dev merge, gateway persist). E2E verified the reported /model switch resolves cleanly to opencode-zen and the stale-base_url clear/preserve behavior with real config I/O.

Closes the picker side of the OpenCode Zen report; salvages #49129 (@Afnath-max) and #51488 (@ipriyaaanshu) with authorship preserved.

Infographic

Model Picker Fixes

Afnath-max and others added 5 commits June 27, 2026 21:04
Follow-up to the salvaged #49129 commit. The original change flipped the
shared generic-provider merge in provider_model_ids() to live-first
unconditionally, which regressed curated-first for single providers
(kimi/zai, #46309) — and the PR encoded that regression by flipping the
kimi-coding and zai test assertions to expect live-first.

Gate live-first on an explicit _LIVE_FIRST_PICKER_PROVIDERS set
({opencode-zen, opencode-go}); every other provider keeps curated-first.
Also widen the uncapped picker + live-first sets to opencode-go, which has
the same 70+ model catalog problem as opencode-zen. Restore the
kimi-coding curated-first test and rewrite the merge-order test to assert
the per-provider contract.
@github-actions

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-7223fc5c vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 11608 on HEAD, 11610 on base (✅ -2)

🆕 New issues (1):

Rule Count
invalid-assignment 1
First entries
tests/run_agent/test_credits_notices_toggle.py:76: [invalid-assignment] invalid-assignment: Object of type `None` is not assignable to attribute `_credits_session_start_micros` of type `int`

✅ Fixed issues (2):

Rule Count
unresolved-attribute 2
First entries
tests/run_agent/test_credits_notices_toggle.py:76: [unresolved-attribute] unresolved-attribute: Unresolved attribute `_credits_session_start_micros` on type `AIAgent`
run_agent.py:3017: [unresolved-attribute] unresolved-attribute: Object of type `Self@get_credits_spent_micros` has no attribute `_credits_session_start_micros`

Unchanged: 6090 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists labels Jun 28, 2026
@teknium1
teknium1 merged commit b304023 into main Jun 28, 2026
30 checks passed
@teknium1
teknium1 deleted the hermes/hermes-7223fc5c branch June 28, 2026 04:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants