Skip to content

fix: restore api keys tab and apply session key to pipeline default m…#504

Open
harz05 wants to merge 1 commit intoarchi-physics:mainfrom
harz05:fix/api-keys-tab
Open

fix: restore api keys tab and apply session key to pipeline default m…#504
harz05 wants to merge 1 commit intoarchi-physics:mainfrom
harz05:fix/api-keys-tab

Conversation

@harz05
Copy link
Copy Markdown

@harz05 harz05 commented Mar 5, 2026

Fixes #475

Problems

  1. The API Keys tab in chat Settings was hidden (<!-- commented out -->) due to a known bug where the session key was ignored.

  2. 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 — In get_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 from dynamic_config (or falls back to services.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

  • Set a fake session key (sk-fake999) → sent a message → got an auth error from OpenAI confirming the session key was injected
  • Cleared session key → chat worked normally with env key
  • API Keys tab visible and functional in Settings modal
Screenshot from 2026-03-06 02-38-35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix api keys tab in chat settings

1 participant