fix(model): isolate custom provider picker credentials (salvage #34757) - #34810
Merged
Conversation
1 task
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
The
/modelpicker no longer merges distinctcustom_providersthat share abase_urlbut differ inkey_envorapi_mode, so selecting a model can no longer route through the wrong credentials and wire protocol.Root cause: the picker grouped custom providers by
(base_url, api_key). When entries usekey_envinstead of an inlineapi_key, theapi_keyfield is empty for all of them, producing an identical group key — distinct providers collapsed into one row, and selection routed through the first provider's key +api_mode.Changes
hermes_cli/model_switch.py: group custom providers by(base_url, credential_identity, api_mode)wherecredential_identityisenv:<KEY_ENV>(no secret values exposed); tighten theis_currenthighlight so a shared base_url only marks a bare-customrow current when exactly one group lives at that URL.scripts/release.py: addzapabobauthor-email mapping.key_env/api_modestay separate (picker + runtime resolution).Validation
custom:gptrow with both models; Claude routes through GPT keycustom:gpt/custom:clauderows, isolated models, correct credentialscustom, GH#17478)Targeted tests: 181 passing across
test_model_switch_custom_providers,test_runtime_provider_resolution,test_user_providers_model_switch, gateway model/discord/telegram pickers. Bug reproduced onmainand verified fixed E2E.Salvages #34757 by @zapabob onto current
main(cherry-picked, authorship preserved). Fixes #34725.Infographic