fix: use main_runtime api_key for custom provider in auxiliary tasks - #17846
Closed
jamesarch wants to merge 1 commit into
Closed
fix: use main_runtime api_key for custom provider in auxiliary tasks#17846jamesarch wants to merge 1 commit into
jamesarch wants to merge 1 commit into
Conversation
When auxiliary.title_generation (or other auxiliary tasks) resolve to the
'custom' provider via an explicit base_url, the api_key fallback chain did
not include the main runtime's api_key. This caused title generation to
fail with 401 'login fail: Please carry the API secret key' when the
main model was configured with minimax-cn credentials.
The custom provider branch in resolve_provider_client() now falls back to
main_runtime.get('api_key') before reaching 'no-key-required', so
auxiliary tasks that reuse the main model's endpoint credentials work
correctly.
Contributor
Author
|
CI failures are unrelated to this PR. Confirmed:
Recommendation:
|
Closed
13 tasks
Contributor
|
Thanks for the focused auxiliary-auth fix. This automated hermes-sweeper review found that current
Closing as implemented on main. |
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.
When auxiliary.title_generation (or other auxiliary tasks) resolve to the 'custom' provider via an explicit base_url, the api_key fallback chain did not include the main runtime's api_key. This caused title generation to fail with 401 'login fail: Please carry the API secret key' when the main model was configured with minimax-cn credentials.
Root cause
In resolve_provider_client(), the 'custom' provider branch builds custom_key with this fallback order:
It was missing: main_runtime.get('api_key'). When an auxiliary task (e.g. title_generation) uses a base_url that resolves to 'custom' provider, and that base_url matches the main runtime's endpoint, the main runtime's api_key should be used as a fallback.
Fix
Added main_runtime.get('api_key') to the custom_key fallback chain, so auxiliary tasks that reuse the main model's endpoint credentials work correctly.
Fixes: (title generation 401 with minimax-cn provider)