There is a UI bug with the current implementation. The "Configure LLM API Key in…
- User
There is a UI bug with the current implementation. The "Configure LLM API Key in Settings" is shown when there is a key configured and shown in the settings.
- Assistant
Good catch — I traced the UI text to
src/components/ChatWindow.tsx:367, where the footer shows:Using ...whenconfig.llmApiKeyis truthyConfigure LLM API key in Settingsotherwise
I also checked
src/components/SettingsDialog.tsxand config state flow insrc/store/slices/configSlice.ts. The most likely mismatch is that the Settings dialog can display a key-looking value while the persisted Redux config used by ChatWindow is still empty (for example unsaved/autofilled input behavior), so the banner logic still falls into the warning state.Plan I’d execute:
- Add a small derived flag in ChatWindow (e.g.
hasLlmApiKey = config.llmApiKey.trim().length > 0) and use that consistently for footer status.
- User
save-only is ok. The key may be set in an env var so would be there when the application starts
- Assistant
Perfect — save-only plus env-var-at-startup is a clear target.
Implementation plan (no code changes yet):
- Reproduce the exact path with env defaults:
- Start app with
VITE_LLM_API_KEYset. - Confirm
Settingsshows API key field populated. - Confirm footer in chat currently still shows the warning (the bug).
- Start app with
- Fix status derivation in
src/components/ChatWindow.tsx:- Compute a single
hasConfiguredLlmApiKeyboolean from persisted config (trim().length > 0). - Use that boolean for the footer status text so it cannot drift from the real saved config state.
- Keep save-only behavior (no live modal draft wiring).
- Compute a single
- Add targeted regression tests in
src/components/ChatWindow.test.tsx:- Shows
Using <model> via <backend>whenllmApiKeyexists in config (simulates env-backed startup state). - Shows
Configure LLM API key in Settingswhen is empty.
- Shows
- Reproduce the exact path with env defaults:
- User
yes
- Assistant
Fixed it — the footer now uses a stricter “configured key” check and has regression coverage.
- In
src/components/ChatWindow.tsx:245, I addedhasConfiguredLlmApiKey = config.llmApiKey.trim().length > 0. - In
src/components/ChatWindow.tsx:370, the footer status now uses that boolean instead of raw truthiness, so whitespace/empty values no longer count as configured. - In
src/components/ChatWindow.test.tsx:38, I mademakeStoreaccept anllmApiKeyoverride. - In
src/components/ChatWindow.test.tsx:197, I added tests for:- configured key => shows
Using <model> via <backend> - empty/whitespace key => shows
Configure LLM API key in Settings
- configured key => shows
- I updated planning/docs per repo rules in
plans/plan.mdandagents.md.
Validation run completed successfully:
npm run lintnpm run buildnpm test(112 tests passing)
If you want, I can also add one small UI cue in Settings (e.g., “Key loaded from env/session”) to reduce confusion when users compare modal state vs footer status.
- In
- User
I am still seeing the warning after restarting the app