Skip to content

fix(models): OpenRouter @preset references no longer rejected by /model (salvage #89129) - #99633

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-57d251db
Aug 31, 2026
Merged

teknium1 merged 2 commits into
mainfrom
hermes/hermes-57d251db

Conversation

@teknium1

Copy link
Copy Markdown
Collaborator

Summary

/model @preset/<slug> --provider openrouter now works — OpenRouter account-scoped presets are accepted instead of being rejected against the public /v1/models listing (salvage of #89129 by @mbac; portion of #31739; matches a fresh Discord report from colorado.rob).

Root cause: presets are account-scoped server-side objects that never appear in OpenRouter's public model listing, so validate_requested_model()'s catalog probe always missed and rejected them; config.yaml worked because it skips interactive validation.

Changes

  • hermes_cli/models.py: accept direct @preset/<slug> on provider openrouter without a /models probe; validate combined <model>@preset/<slug> by its base model; preserve the preset suffix through both auto-correct sites (hoisted into one _with_preset_suffix() helper in a follow-up commit); reject malformed slugs pre-network with a clear message.
  • tests/hermes_cli/test_openrouter_preset_validation.py: 245 lines — direct/combined refs, slug syntax, provider isolation, custom endpoints, autocorrect suffix preservation, and a real HERMES_HOME → alias → switch_model subprocess path.

Validation

Scenario (live against real OpenRouter listing) Before (main) After
@preset/glm-53-flash-fp8 ✗ "not found in this provider's model listing" (reporter's exact error) ✓ accepted
z-ai/glm-5.3-flash@preset/glm-53-flash-fp8 — ✓ base validated, suffix kept
z-ai/glm-5.3-flsh@preset/... (typo) — ✓ auto-corrected with suffix preserved
@preset/bad slug! — ✗ rejected before any network call

Targeted suites: test_openrouter_preset_validation.py + test_model_validation.py + test_models.py — 147 passed.

Live repro: reporter's exact command reproduced byte-for-byte on origin/main (✗ Model @preset/glm-53-flash-fp8 was not found... with the same three suggestions), confirmed accepted after the fix, via real validate_requested_model() calls with a live OpenRouter key.

Custom-named providers pointing at openrouter.ai (#97907 / #97951) are intentionally out of scope — separate follow-up.

Infographic

OpenRouter presets work in /model

mbac and others added 2 commits August 31, 2026 11:05
Follow-up to salvaged PR #89129: both auto-correct sites now call
_with_preset_suffix() so a future correction path can't forget to
re-attach the @preset/<slug> routing suffix.
@github-actions

github-actions Bot commented Aug 31, 2026 •

Copy link
Copy Markdown

૮ >ﻌ< ა ci review

ran on d83c76a — refactor(models): hoist preset suffix re-attachment into one

⚠️ Warnings

OSV vulnerability scan · View job

6 known vulnerabilities found in pinned dependencies.

How to fix:

Review the findings in the Security tab. Update the affected dependencies if a patched version is available.


debug info

CI timings

CI timings · View report · View job

Wall time 4m11s vs 4m7s (+1.6%). 9 job(s) slower, 2 faster, 1 unchanged.

  • OS-specific tests / Windows-only tests: +16.0s
  • Check contributors / check-attribution: +10.0s
  • OS-specific tests / macOS-only tests: +8.0s
  • Python tests / Run tests: +6.0s
  • Python tests / e2e: +3.0s

@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard provider/openrouter OpenRouter aggregator P2 Medium — degraded but workaround exists labels Aug 31, 2026
@alt-glitch

Copy link
Copy Markdown

This was generated by AI during triage.

Supersedes #89129 with its OpenRouter preset-validation repair salvaged onto current main while preserving credit.

@teknium1
teknium1 merged commit c3948e6 into main Aug 31, 2026
38 checks passed
@teknium1
teknium1 deleted the hermes/hermes-57d251db branch August 31, 2026 18:19
acedatacloud-dev added a commit to AceDataCloud/hermes-agent that referenced this pull request Sep 13, 2026
* feat(gateway): fire agent_loop_stopped plugin hook on interrupt

Reapplied onto current main. The branch had drifted ~3348 commits and a trial
merge produced 48 conflict markers, so this is the same change re-landed rather
than a rebase of the old history.

_interrupt_and_clear_session interrupts the running agent without signalling
plugins, so a plugin holding a per-turn external resource — an outbound RPC
waiting on a tool result the loop will never consume — has no way to learn the
turn is gone. Dispatch agent_loop_stopped immediately after
running_agent.interrupt(), gated on a real running agent: the pending-sentinel
/stop path has no in-flight work, so firing there would be noise.

Per review on NousResearch#27208, the current helper's behaviour is preserved untouched —
multiplex-aware _adapter_for_source() resolution and cached-agent eviction both
still run; the hook is additive and its dispatch failures are swallowed so a
misbehaving plugin cannot break an interrupt.

Tests fail without the change (hook registration and dispatch) and pass with
it. The three failures in tests/hermes_cli/test_plugins.py::TestPluginDiscovery
are pre-existing on this checkout and reproduce with the change stashed.

* feat(tui_gateway): fire agent_loop_stopped on session.interrupt too

Widens the new hook to the sibling interrupt surface: the TUI/desktop
session.interrupt path stops a live turn exactly like the gateway's
/stop, so plugins holding per-turn external resources get the same
signal there (platform='tui'). Gated on a genuinely running turn;
dispatch failures are swallowed so a plugin can never break the
interrupt. Docs updated to describe both surfaces.

Inspired by ChatGPT Work / Codex CLI 0.150.0 'Interrupt' hooks
(hooks that run when an active top-level turn is interrupted).

* docs: document OpenRouter @preset references in /model (follow-up to NousResearch#99633)

* feat: resume x402 MCP tool calls

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* ci: publish AceDataCloud Hermes image

* chore: map AceDataCloud contributor

* ci: use hosted runners in fork

* feat: allow managed x402 payment enablement

* ci: preserve full tests on hosted runners

* ci: bound test workers on hosted runner

* fix: release quickstart lock before completion

---------

Co-authored-by: Franci Penov <francip@gmail.com>
Co-authored-by: Teknium <127238744+teknium1@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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 P2 Medium — degraded but workaround exists provider/openrouter OpenRouter aggregator type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants