fix(gateway): read api_key from model config in /model command handler#19683
Open
Cyrene963 wants to merge 1 commit into
Open
fix(gateway): read api_key from model config in /model command handler#19683Cyrene963 wants to merge 1 commit into
Cyrene963 wants to merge 1 commit into
Conversation
The /model command handler in the messaging gateway read model.default, model.provider, and model.base_url from config but did not read model.api_key. This caused probe_api_models() to send unauthenticated requests to custom endpoints that require bearer tokens, resulting in 401 errors. Fixes NousResearch#18681
Collaborator
Collaborator
|
Likely duplicate of #18685 |
Author
|
Closing as duplicate of #18685 (LeonSGP43) — same one-line fix for reading api_key from model config in /model handler. Local patch remains active in Cyrene963/hermes-patches until #18685 is merged. |
Author
|
Re-evaluating closure status for #19683 I closed this as a duplicate earlier, but I rechecked the referenced upstream PR(s) and none of them are merged yet:
Because the underlying fix does not appear to have landed upstream, closing this solely as a duplicate may have been premature. I am reopening this PR so it can remain trackable unless maintainers prefer a different canonical PR. |
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
Fixes #18681
The
/modelcommand handler in the messaging gateway readsmodel.default,model.provider, andmodel.base_urlfromconfig.yaml, but did not readmodel.api_key. This causedprobe_api_models()to send unauthenticated requests to custom endpoints that require bearer tokens, resulting in 401 errors.Fix
Added one line after the
current_base_urlassignment:This matches the pattern already used in
tui_gateway/server.pywhich correctly reads the API key from the agent object.Testing
Verified that the
/modelcommand now correctly passes the API key when probing custom endpoints with authentication.Closes #18681