-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Fix: ElevenLabs API Key Not Persisting #6557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a bug where ElevenLabs API keys were not persisting in the desktop UI. The core fix changes the key existence check from keyExists === true to keyExists !== null to properly detect stored keys.
Changes:
- Fixed key existence detection logic in both the settings hook and key input component
- Added masked value display (••••••••••••••••) for existing keys with focus/blur handling
- Added 32-character minimum validation for ElevenLabs API keys
- Improved UI styling for provider dropdown (overflow, width, text wrapping)
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
ui/desktop/src/hooks/useDictationSettings.ts |
Fixed key existence check from === true to !== null |
ui/desktop/src/components/settings/dictation/ElevenLabsKeyInput.tsx |
Enhanced key persistence logic with masked display, validation, and better state handling |
ui/desktop/src/components/settings/dictation/VoiceDictationToggle.tsx |
Changed overflow from hidden to visible to prevent dropdown clipping |
ui/desktop/src/components/settings/dictation/ProviderSelector.tsx |
Improved dropdown styling with better width constraints and text formatting |
Comments suppressed due to low confidence (1)
ui/desktop/src/components/settings/dictation/ElevenLabsKeyInput.tsx:52
- The unmount effect saves the key without validation. If a user enters an invalid key (less than 32 characters) and the component unmounts before onBlur fires, the invalid key will be saved. Consider adding the same validation here or removing this unmount save since onBlur already handles saving.
useEffect(() => {
return () => {
if (elevenLabsApiKeyRef.current && elevenLabsApiKeyRef.current !== '••••••••••••••••') {
const keyToSave = elevenLabsApiKeyRef.current;
if (keyToSave.trim()) {
upsert(ELEVENLABS_API_KEY, keyToSave, true).catch((error) => {
console.error('Error saving ElevenLabs API key on unmount:', error);
});
}
}
};
ui/desktop/src/components/settings/dictation/ElevenLabsKeyInput.tsx
Outdated
Show resolved
Hide resolved
ui/desktop/src/components/settings/dictation/ElevenLabsKeyInput.tsx
Outdated
Show resolved
Hide resolved
ui/desktop/src/components/settings/dictation/ElevenLabsKeyInput.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- ui/desktop/package-lock.json: Language not supported
ui/desktop/src/components/settings/dictation/ElevenLabsKeyInput.tsx
Outdated
Show resolved
Hide resolved
ui/desktop/src/components/settings/dictation/ElevenLabsKeyInput.tsx
Outdated
Show resolved
Hide resolved
ui/desktop/src/components/settings/dictation/ElevenLabsKeyInput.tsx
Outdated
Show resolved
Hide resolved
ui/desktop/src/components/settings/dictation/ElevenLabsKeyInput.tsx
Outdated
Show resolved
Hide resolved
ui/desktop/src/components/settings/dictation/ElevenLabsKeyInput.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- ui/desktop/package-lock.json: Language not supported
f9881b6 to
e8b6286
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.
Files not reviewed (1)
- ui/desktop/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)
ui/desktop/src/hooks/dictationConstants.ts:7
- Assignment to variable isSecretKeyConfigured, which is declared constant.
export const isSecretKeyConfigured = (response: unknown): boolean =>
|
Updated UX cc : @lifeizhou-ap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- ui/desktop/package-lock.json: Language not supported
|
Thank you @Abhijay007! One thing I noticed the changes to optimise api call in the PR have been removed in this PR. Just wondering whether it is intentional or not. |
7fec68f to
a90144a
Compare
oh yea, thanks @lifeizhou-ap for letting me know I made some mistakes while resolving merge conflicts and missed those changes 😅 , I updated em now |
a90144a to
af114d5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- ui/desktop/package-lock.json: Language not supported
|
It looks like comments were addressed, tagging @lifeizhou-ap and @zanesq again! |
| setElevenLabsApiKey(''); | ||
| setValidationError(''); | ||
| setIsEditing(false); | ||
| await loadKey(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Abhijay007 just curious why we hav to loadKey again in the upsert and remove? It added an extra call to the server side and it seems unnecessary? Shall we just update the cache and hasElevenLabsKey instead of the additional call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was mentioned here by copoilt : #6557 (comment) so I thought of implementing it
| @@ -1,5 +1,6 @@ | |||
| import { useState, useEffect, useRef } from 'react'; | |||
| import { useState, useEffect, useCallback } from 'react'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
frankly, this whole module feels rather complicated. aren't we just setting an API key? there's validation code, but all it seems to do is check that the API key is set. or that the server failed but that's not very useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
frankly, this whole module feels rather complicated. aren't we just setting an API key? there's validation code, but all it seems to do is check that the API key is set. or that the server failed but that's not very useful.
@lifeizhou-ap , @DOsinga should I consider this update in this PR or make another one for this refactor ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Abhijay007,
Let's make another PR for this refactor.
Hi @DOsinga Yes. This is my fault because I did not extract Now I realised that I has overthought about the risk of extracting the |
|
Hi @Abhijay007, I also checked out your branch and it works well! One feedback about the "Remove" button in UI. This is your current UI I feel it will be clearer to user if we put next to "Update API Key". WDTY? (does not need to be in this PR. we can address this later if this makes sense) |
Signed-off-by: Abhijay007 <[email protected]>
Signed-off-by: Abhijay007 <[email protected]>
Signed-off-by: Abhijay007 <[email protected]>
Signed-off-by: Abhijay007 <[email protected]>
Signed-off-by: Abhijay007 <[email protected]>
Signed-off-by: Abhijay007 <[email protected]>
Signed-off-by: Abhijay007 <[email protected]>
I think it's nice if we handle it in another PR |
Signed-off-by: Abhijay007 <[email protected]>
af114d5 to
e877fe2
Compare
Signed-off-by: Abhijay007 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.
Thank you @Abhijay007 to extract it! |
…upport * origin/main: (79 commits) fix[format/openai]: return error on empty msg. (#6511) Fix: ElevenLabs API Key Not Persisting (#6557) Logging uplift for model training purposes (command injection model) [Small change] (#6330) fix(goose): only send agent-session-id when a session exists (#6657) BERT-based command injection detection in tool calls (#6599) chore: [CONTRIBUTING.md] add Hermit to instructions (#6518) fix: update Gemini context limits (#6536) Document r slash command (#6724) Upgrade GitHub Actions to latest versions (#6700) fix: Manual compaction does not update context window. (#6682) Removed the Acceptable Usage Policy (#6204) Document spellcheck toggle (#6721) fix: docs workflow cleanup and prevent cancellations (#6713) Docs: file bug directly (#6718) fix: dispatch ADD_ACTIVE_SESSION event before navigating from "View All" (#6679) Speed up Databricks provider init by removing fetch of supported models (#6616) fix: correct typos in documentation and Justfile (#6686) docs: frameDomains and baseUriDomains for mcp apps (#6684) docs: add Remotion video creation tutorial (#6675) docs: export recipe and copy yaml (#6680) ... # Conflicts: # ui/desktop/src/hooks/useChatStream.ts
…ovider * 'main' of github.com:block/goose: fix slash and @ keyboard navigation popover background color (#6550) fix[format/openai]: return error on empty msg. (#6511) Fix: ElevenLabs API Key Not Persisting (#6557) Logging uplift for model training purposes (command injection model) [Small change] (#6330) fix(goose): only send agent-session-id when a session exists (#6657) BERT-based command injection detection in tool calls (#6599) chore: [CONTRIBUTING.md] add Hermit to instructions (#6518) fix: update Gemini context limits (#6536) Document r slash command (#6724) Upgrade GitHub Actions to latest versions (#6700)
* 'main' of github.com:block/goose: Create default gooseignore file when missing (#6498) fix slash and @ keyboard navigation popover background color (#6550) fix[format/openai]: return error on empty msg. (#6511) Fix: ElevenLabs API Key Not Persisting (#6557) Logging uplift for model training purposes (command injection model) [Small change] (#6330) fix(goose): only send agent-session-id when a session exists (#6657) BERT-based command injection detection in tool calls (#6599) chore: [CONTRIBUTING.md] add Hermit to instructions (#6518) fix: update Gemini context limits (#6536) Document r slash command (#6724) Upgrade GitHub Actions to latest versions (#6700) fix: Manual compaction does not update context window. (#6682) Removed the Acceptable Usage Policy (#6204) Document spellcheck toggle (#6721) fix: docs workflow cleanup and prevent cancellations (#6713) Docs: file bug directly (#6718)





Closes: #6063
PR description
This PR fixes a bug where ElevenLabs API keys were not persisting in the desktop UI.
Changes:
Type of Change
AI Assistance
Testing
Tested in Desktop UI with the whole functionality
Screenshots/Demos (for UX changes)
Before:

After: