fix(model): match bare custom provider by active base URL#28908
Merged
teknium1 merged 1 commit intoMay 19, 2026
Merged
Conversation
Collaborator
|
Related: #28860 (merged) fixes the |
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 the top-level
hermes modelpicker for configs where the active model is stored as bareprovider: customplus amodel.base_url, while multiplecustom_providersare saved.Previously,
hermes modelresolved barecustomthrough the compatibility fallback before checking the active endpoint. That fallback returns the first saved custom provider, so a config with Cerebras first and NeuralWatt active could show Cerebras as current.This PR makes the CLI model picker match bare custom providers by normalized active
model.base_urlbefore falling back to the first saved custom provider. It also preserves raw${...}base URL templates when saving a named custom provider, matching the existing API-key template preservation behavior.Related Issue
N/A - Discord support thread report from DrWayne.
Type of Change
Changes Made
hermes_cli/main.pyselect_provider_and_model().model.provideris barecustomandmodel.base_urlis set, match the active custom provider by normalized loaded base URL before using the bare-custom compatibility fallback.base_urlenv references alongside existingapi_key_refmetadata.model.base_urlusing the raw${VAR}template when the selected named custom provider came from an env-ref-backed config entry.tests/hermes_cli/test_custom_provider_model_switch.py${NEURALWATT_API_BASE}inmodel.base_urlwhile still probing the expanded URL.How to Test
model.provider: customwithmodel.base_urlpointing at the second savedcustom_providersentry.hermes model.model.base_urlis marked current, not the first saved custom provider.Focused local checks run:
uv run --frozen pytest -q -o addopts='' tests/hermes_cli/test_custom_provider_model_switch.py->13 passeduv run --frozen pytest -q -o addopts='' tests/hermes_cli/test_custom_provider_model_switch.py tests/hermes_cli/test_model_switch_custom_providers.py tests/hermes_cli/test_setup.py tests/hermes_cli/test_setup_model_provider.py -k 'custom_provider or custom_providers or named_custom or select_provider_and_model'->36 passed, 28 deselectedpython -m py_compile hermes_cli/main.py tests/hermes_cli/test_custom_provider_model_switch.py-> passedgit diff --check -- hermes_cli/main.py tests/hermes_cli/test_custom_provider_model_switch.py-> passedFull local suite run after opening this draft PR:
scripts/run_tests.sh-> failed:16 failed, 24532 passed, 54 skipped, 250 warnings in 704.83s (0:11:44)HERMES_HOMEbefore and after the run was empty / unchanged.tests/gateway/test_api_server.py::TestAdapterInit::test_default_configtests/gateway/test_approve_deny_commands.py::TestBlockingApprovalE2E::test_blocking_approval_approve_oncetests/gateway/test_approve_deny_commands.py::TestBlockingApprovalE2E::test_blocking_approval_denytests/gateway/test_config.py::TestLoadGatewayConfig::test_bridges_quoted_false_platform_enabled_from_config_yamltests/gateway/test_discord_bot_filter.py::TestDiscordBotFilter::test_default_is_nonetests/gateway/test_restart_resume_pending.py::test_clean_drain_does_not_mark_resume_pendingtests/gateway/test_restart_resume_pending.py::test_drain_timeout_only_marks_still_running_sessionstests/gateway/test_runner_startup_failures.py::test_start_gateway_replace_force_uses_terminate_pidtests/hermes_cli/test_update_gateway_restart.py::TestLaunchdPlistPath::test_plist_path_starts_with_venv_bintests/hermes_cli/test_update_hangup_protection.py::TestInstallHangupProtection::test_wraps_stdout_and_stderr_with_mirrortests/tools/test_file_operations.py::TestGitBaselineCheck::test_git_not_available_returns_nonetests/tools/test_file_operations.py::TestGitBaselineCheck::test_not_in_git_repo_returns_nonetests/tools/test_file_operations.py::TestGitBaselineCheck::test_clean_repo_returns_nonetests/tools/test_file_operations.py::TestGitBaselineCheck::test_dirty_repo_returns_warningtests/tools/test_file_operations.py::TestGitBaselineCheck::test_write_file_includes_git_warning_when_dirtytests/tools/test_tirith_security.py::TestDiskFailureMarker::test_cosign_missing_marker_clears_when_cosign_appearsuv run --frozen ruff check hermes_cli/main.py tests/hermes_cli/test_custom_provider_model_switch.pycould not run locally becauseruffis not available in this uv environment.Checklist
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/AFor New Skills
N/A
Screenshots / Logs
Focused local checks passed. Full local suite failure details are listed above.