fix: restore api keys tab and apply session key to pipeline default m…#504
Open
harz05 wants to merge 1 commit intoarchi-physics:mainfrom
Open
fix: restore api keys tab and apply session key to pipeline default m…#504harz05 wants to merge 1 commit intoarchi-physics:mainfrom
harz05 wants to merge 1 commit intoarchi-physics:mainfrom
Conversation
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.
Fixes #475
Problems
The API Keys tab in chat Settings was hidden (
<!-- commented out -->) due to a known bug where the session key was ignored.When a user saved a session API key but did NOT explicitly select a provider in the UI (i.e. used the pipeline default model), the session key was never looked up and the deployment admin key was always used instead, reverting any per-user override.
Fix
index.html— Uncommented the API Keys nav button and section. Updated the description to clarify keys live in the browser session only.app.py— Inget_chat_response_stream(), extended the session key lookup to also cover the no-provider-selected case: when no explicit provider comes in from the frontend, the code now reads the pipeline's active model fromdynamic_config(or falls back toservices.chat_app.default_provider), checks if the user has a session key for that provider, and injects it — so the BYOK key is used transparently even with the default pipeline model.Tested
sk-fake999) → sent a message → got an auth error from OpenAI confirming the session key was injected