Skip to content

fix(model-switch): mark bare custom provider as current#23559

Closed
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:codex/20811-custom-provider-current
Closed

fix(model-switch): mark bare custom provider as current#23559
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:codex/20811-custom-provider-current

Conversation

@LeonSGP43

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes custom-provider selection state when the current provider slug is the bare custom bucket, so the authenticated provider group is still marked current when the active base URL matches.

Related Issue

Fixes #20811

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • Updated hermes_cli/model_switch.py to compare the current base URL for grouped custom providers
  • Tightened the existing custom-provider regression coverage in tests/hermes_cli/test_model_switch_custom_providers.py

How to Test

  1. Run 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. Run uv run --frozen ruff check hermes_cli/model_switch.py tests/hermes_cli/test_model_switch_custom_providers.py
  3. Confirm both commands pass

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS 15.x

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / 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

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard labels May 11, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #22473 — same fix marking bare 'custom' provider as current via URL comparison fallback. Both fix #20811.

@alt-glitch alt-glitch added the duplicate This issue or pull request already exists label May 11, 2026
@austinpickett austinpickett requested a review from Copilot May 18, 2026 14:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, the is_current check for grouped custom providers now also matches when the normalized group URL equals the normalized current_base_url.
  • Extends an existing regression test to assert is_current is True for 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.

@teknium1

Copy link
Copy Markdown
Contributor

Merged via #28860 — cherry-picked onto current main with your authorship preserved in git log. Thanks @LeonSGP43!

@teknium1 teknium1 closed this May 19, 2026
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 duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix: is_current check fails for bare 'custom' provider in custom endpoints section

5 participants