fix(models): OpenRouter @preset references no longer rejected by /model (salvage #89129) - #99633
Merged
Merged
Conversation
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.
૮ >ﻌ< ა ci reviewran on d83c76a — refactor(models): hoist preset suffix re-attachment into one
|
Supersedes #89129 with its OpenRouter preset-validation repair salvaged onto current main while preserving credit. |
This was referenced Aug 31, 2026
teknium1
added a commit
that referenced
this pull request
Sep 13, 2026
teknium1
added a commit
that referenced
this pull request
Sep 13, 2026
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/model @preset/<slug> --provider openrouternow works — OpenRouter account-scoped presets are accepted instead of being rejected against the public/v1/modelslisting (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 provideropenrouterwithout a/modelsprobe; 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_modelsubprocess path.Validation
@preset/glm-53-flash-fp8z-ai/glm-5.3-flash@preset/glm-53-flash-fp8z-ai/glm-5.3-flsh@preset/...(typo)@preset/bad slug!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 realvalidate_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