fix(model-switch): mark bare custom provider as current#23559
Closed
LeonSGP43 wants to merge 1 commit into
Closed
Conversation
Collaborator
austinpickett
approved these changes
May 18, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a bug in the /model picker where a custom provider was not marked as current when the active provider slug is the bare "custom" string. The existing slug-equality check is augmented with a base-URL fallback so the active custom endpoint is correctly highlighted.
Changes:
- In
list_authenticated_providers, theis_currentcheck for grouped custom providers now also matches when the normalized group URL equals the normalizedcurrent_base_url. - Extends an existing regression test to assert
is_current is Truefor the recovered custom group.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| hermes_cli/model_switch.py | Adds URL-based fallback for is_current in section 4 custom providers. |
| tests/hermes_cli/test_model_switch_custom_providers.py | Adds an assertion that the bare-custom slug recovery test marks the group as current. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
Merged via #28860 — cherry-picked onto current main with your authorship preserved in git log. Thanks @LeonSGP43! |
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.
What does this PR do?
Fixes custom-provider selection state when the current provider slug is the bare
custombucket, so the authenticated provider group is still marked current when the active base URL matches.Related Issue
Fixes #20811
Type of Change
Changes Made
hermes_cli/model_switch.pyto compare the current base URL for grouped custom providerstests/hermes_cli/test_model_switch_custom_providers.pyHow to Test
uv run --frozen pytest -q -o addopts='' tests/hermes_cli/test_model_switch_custom_providers.py -k 'current_endpoint_uses_current_slug or bare_custom_slug_recovers'uv run --frozen ruff check hermes_cli/model_switch.py tests/hermes_cli/test_model_switch_custom_providers.pyChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
uv run --frozen pytest -q -o addopts='' tests/hermes_cli/test_model_switch_custom_providers.py -k 'current_endpoint_uses_current_slug or bare_custom_slug_recovers'->2 passed