fix(config): custom provider + :free/:beta/:thinking suffix mis-resolution (#1776) - #1783
Closed
Sanjays2402 wants to merge 1 commit into
Closed
fix(config): custom provider + :free/:beta/:thinking suffix mis-resolution (#1776)#1783Sanjays2402 wants to merge 1 commit into
Sanjays2402 wants to merge 1 commit into
Conversation
…ution (nesquena#1776) PR nesquena#1762 fixed the rsplit grammar collision for plain @openrouter:model:free qualifiers, but skipped the fallback whenever the provider hint started with 'custom:' on the assumption that custom providers route directly. That left '@Custom:my-key:some-model:free' broken: rsplit yields provider='custom:my-key:some-model', bare='free' → custom guard skips the split-fallback → returns provider='custom:my-key:some-model', model='free'. Detect the over-split structurally instead of using a known-suffix allowlist: custom hints carry exactly one segment after 'custom:' (constructed at api/config.py:1363 as 'custom:' + entry_name). So any rsplit result of 'custom:<a>:<b>' with bare model '<c>' has eaten one model segment — peel it back with a second rsplit and prepend it to the bare model. This is robust for :free / :beta / :thinking / :preview / any future OpenRouter suffix without an allowlist to maintain. Adds 5 regression tests covering the matrix (free/beta/thinking/preview/ slashed-model). All 7 existing nesquena#1744 tests still pass; nesquena#1228 tests unaffected. Co-authored-by: Cake <51058514+Sanjays2402@users.noreply.github.com>
Collaborator
|
Thanks @Sanjays2402 — this shipped in v0.51.18 (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 existing installs after Release notes: https://github.com/nesquena/hermes-webui/releases/tag/v0.51.18 |
pull Bot
pushed a commit
to soitun/hermes-webui
that referenced
this pull request
May 7, 2026
…eta/:thinking suffix mis-resolution by @Sanjays2402
pull Bot
pushed a commit
to soitun/hermes-webui
that referenced
this pull request
May 7, 2026
…1789, nesquena#1790, nesquena#1791, nesquena#1794) Constituent PRs: - nesquena#1783 (@Sanjays2402) custom provider + :free/:beta/:thinking suffix fix. Closes nesquena#1776. - nesquena#1789 (@Michaelyklam) preserve sidebar scrolling while streaming. Closes nesquena#1784. - nesquena#1790 (@Michaelyklam) keep workspace open from preview breadcrumb. Closes nesquena#1785. - nesquena#1791 (@Michaelyklam) keep assistant-only stream deltas on current turn. Closes nesquena#1787. - nesquena#1794 (@nesquena-hermes, APPROVED by @nesquena) UX bundle: rail tooltip cascade fix, +new-conversation has-tooltip--bottom-right variant, context-menu hover-bg, rename pre-fill via setSelectionRange. Tests: 4723 → 4747 collected (+24). 4733 passed, 0 failed in 149s. Pre-release verification: - All 5 PRs CI-green individually - File overlaps (style.css + ui.js between nesquena#1789 + nesquena#1794) auto-merged cleanly - node -c clean on all 4 changed JS files - Browser API sanity 11/11 endpoints - Pre-stamp re-fetch: all PR heads match local rebases - Opus advisor: SHIP all 5, 0 MUST-FIX, 1 SHOULD-NOTE on test pattern divergence (acceptable) Closes nesquena#1776, nesquena#1784, nesquena#1785, nesquena#1787.
Du7chManiac
pushed a commit
to TheCouchCoder-com/hermes-webui
that referenced
this pull request
May 13, 2026
v0.51.18 — 5-PR batch (nesquena#1783, nesquena#1789, nesquena#1790, nesquena#1791, nesquena#1794) # Conflicts: # CHANGELOG.md
SysAdminDoc
pushed a commit
to SysAdminDoc/hermes-webui
that referenced
this pull request
Jun 26, 2026
…eta/:thinking suffix mis-resolution by @Sanjays2402
SysAdminDoc
pushed a commit
to SysAdminDoc/hermes-webui
that referenced
this pull request
Jun 26, 2026
…1789, nesquena#1790, nesquena#1791, nesquena#1794) Constituent PRs: - nesquena#1783 (@Sanjays2402) custom provider + :free/:beta/:thinking suffix fix. Closes nesquena#1776. - nesquena#1789 (@Michaelyklam) preserve sidebar scrolling while streaming. Closes nesquena#1784. - nesquena#1790 (@Michaelyklam) keep workspace open from preview breadcrumb. Closes nesquena#1785. - nesquena#1791 (@Michaelyklam) keep assistant-only stream deltas on current turn. Closes nesquena#1787. - nesquena#1794 (@nesquena-hermes, APPROVED by @nesquena) UX bundle: rail tooltip cascade fix, +new-conversation has-tooltip--bottom-right variant, context-menu hover-bg, rename pre-fill via setSelectionRange. Tests: 4723 → 4747 collected (+24). 4733 passed, 0 failed in 149s. Pre-release verification: - All 5 PRs CI-green individually - File overlaps (style.css + ui.js between nesquena#1789 + nesquena#1794) auto-merged cleanly - node -c clean on all 4 changed JS files - Browser API sanity 11/11 endpoints - Pre-stamp re-fetch: all PR heads match local rebases - Opus advisor: SHIP all 5, 0 MUST-FIX, 1 SHOULD-NOTE on test pattern divergence (acceptable) Closes nesquena#1776, nesquena#1784, nesquena#1785, nesquena#1787.
SysAdminDoc
pushed a commit
to SysAdminDoc/hermes-webui
that referenced
this pull request
Jun 26, 2026
v0.51.18 — 5-PR batch (nesquena#1783, nesquena#1789, nesquena#1790, nesquena#1791, nesquena#1794)
bernyforce
pushed a commit
to bernyforce/hermes-webui
that referenced
this pull request
Jul 29, 2026
…eta/:thinking suffix mis-resolution by @Sanjays2402
bernyforce
pushed a commit
to bernyforce/hermes-webui
that referenced
this pull request
Jul 29, 2026
…1789, nesquena#1790, nesquena#1791, nesquena#1794) Constituent PRs: - nesquena#1783 (@Sanjays2402) custom provider + :free/:beta/:thinking suffix fix. Closes nesquena#1776. - nesquena#1789 (@Michaelyklam) preserve sidebar scrolling while streaming. Closes nesquena#1784. - nesquena#1790 (@Michaelyklam) keep workspace open from preview breadcrumb. Closes nesquena#1785. - nesquena#1791 (@Michaelyklam) keep assistant-only stream deltas on current turn. Closes nesquena#1787. - nesquena#1794 (@nesquena-hermes, APPROVED by @nesquena) UX bundle: rail tooltip cascade fix, +new-conversation has-tooltip--bottom-right variant, context-menu hover-bg, rename pre-fill via setSelectionRange. Tests: 4723 → 4747 collected (+24). 4733 passed, 0 failed in 149s. Pre-release verification: - All 5 PRs CI-green individually - File overlaps (style.css + ui.js between nesquena#1789 + nesquena#1794) auto-merged cleanly - node -c clean on all 4 changed JS files - Browser API sanity 11/11 endpoints - Pre-stamp re-fetch: all PR heads match local rebases - Opus advisor: SHIP all 5, 0 MUST-FIX, 1 SHOULD-NOTE on test pattern divergence (acceptable) Closes nesquena#1776, nesquena#1784, nesquena#1785, nesquena#1787.
bernyforce
pushed a commit
to bernyforce/hermes-webui
that referenced
this pull request
Jul 29, 2026
v0.51.18 — 5-PR batch (nesquena#1783, nesquena#1789, nesquena#1790, nesquena#1791, nesquena#1794)
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
Closes #1776.
PR #1762 fixed the
rsplitgrammar collision for plain@openrouter:model:freequalifiers, but skipped the fallback whenever the provider hint started withcustom:on the assumption that custom providers route directly. That left@custom:my-key:some-model:freebroken — issue body and the maintainer's confirmation comment trace the exact failure mode.Approach
Adopted the maintainer's recommended approach (no allowlist needed). Custom hints carry exactly one segment after
custom:(constructed atapi/config.py:1363as\"custom:\" + entry_name.lower().replace(\" \", \"-\")), so any rsplit result ofcustom:<a>:<b>with bare model<c>has eaten a model segment. Peel it back with a second rsplit and prepend to the bare model.Robust for
:free/:beta/:thinking/:preview/ any future OpenRouter suffix — no allowlist to keep in sync.Resolution matrix (verified by tests)
@custom:my-key:some-model:freecustom:my-keysome-model:free✅@custom:my-key:some-model:betacustom:my-keysome-model:beta✅@custom:my-key:some-model:thinkingcustom:my-keysome-model:thinking✅@custom:my-key:some-model:previewcustom:my-keysome-model:preview✅@custom:my-key:org/model:freecustom:my-keyorg/model:free✅@custom:my-key:some-model(no suffix)custom:my-keysome-model✅ (existing test)@openrouter:tencent/hy3-preview:freeopenroutertencent/hy3-preview:free✅ (existing test)@anthropic:claude-sonnet-4.6anthropicclaude-sonnet-4.6✅ (existing test)Tests
tests/test_resolve_model_provider_free_suffix.pycovering the issue matrixtencent/hy3-preview:freefails with API key not found error in WebUI #1744 tests still passOpen question (left for separate issue)
Per the maintainer's comment:
entry_name.lower().replace(\" \", \"-\")doesn't strip colons, so a user who literally names a custom provider\"foo:bar\"would still produce acustom:foo:barslug that this fix would mis-handle. Probably worth a separate input-validation issue to forbid:incustom_providernames rather than complicating this resolver. Happy to file a follow-up if useful.