-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Optimise load config in UI #6662
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 optimizes config loading in the desktop UI to improve performance, particularly around dictation settings and provider configuration. The main issue being addressed appears to be excessive calls to read config values (especially secret keys from the keychain).
Changes:
- Add module-level caching for ElevenLabs API key checks to avoid redundant keychain reads
- Fix
getProviderscallback memoization in ConfigContext using a ref to prevent unnecessary recreations - Consolidate dictation settings retrieval to eliminate duplicate hook calls
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
ui/desktop/src/hooks/useWhisper.ts |
Add constant for elevenlabs provider and export dictationSettings |
ui/desktop/src/hooks/useDictationSettings.ts |
Implement module-level cache for ElevenLabs key with conditional loading |
ui/desktop/src/hooks/dictationConstants.ts |
Add DICTATION_PROVIDER_ELEVENLABS constant and isSecretKeyConfigured helper |
ui/desktop/src/components/settings/dictation/VoiceDictationToggle.tsx |
Replace string literal with constant |
ui/desktop/src/components/settings/dictation/ProviderSelector.tsx |
Replace string literals with constant |
ui/desktop/src/components/settings/dictation/ProviderInfo.tsx |
Replace string literal with constant |
ui/desktop/src/components/settings/dictation/ElevenLabsKeyInput.tsx |
Use helper function and update cache, remove debug logs |
ui/desktop/src/components/bottom_menu/BottomMenuExtensionSelection.tsx |
Add loading state to prevent button visibility flicker |
ui/desktop/src/components/ConfigContext.tsx |
Fix getProviders memoization with ref pattern |
ui/desktop/src/components/ChatInput.tsx |
Get dictationSettings from useWhisper, remove duplicate hook call |
crates/goose-server/src/routes/config_management.rs |
Add 3-second debug sleep for secret config reads (TODO comment) |
| // TODO: Remove this - simulating slow keychain access for debugging | ||
| if query.is_secret { | ||
| tokio::time::sleep(std::time::Duration::from_secs(3)).await; | ||
| } | ||
|
|
Copilot
AI
Jan 23, 2026
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.
This debug code adds a 3-second delay to all secret config reads and should not be merged to production. Remove this entire block before merging.
| // TODO: Remove this - simulating slow keychain access for debugging | |
| if query.is_secret { | |
| tokio::time::sleep(std::time::Duration::from_secs(3)).await; | |
| } |
|
Thanks! |
* origin/main: 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) Test against fastmcp (#6666) docs: mid-session changes (#6672) Fix MCP elicitation deadlock and improve UX (#6650) chore: upgrade to rmcp 0.14.0 (#6674) [docs] add MCP-UI to MCP Apps blog (#6664) ACP get working dir from args.cwd (#6653) Optimise load config in UI (#6662) # Conflicts: # ui/desktop/src/components/Layout/AppLayout.tsx
…o dkatz/canonical-context * 'dkatz/canonical-provider' of github.com:block/goose: (27 commits) docs: add Remotion video creation tutorial (#6675) docs: export recipe and copy yaml (#6680) Test against fastmcp (#6666) docs: mid-session changes (#6672) Fix MCP elicitation deadlock and improve UX (#6650) chore: upgrade to rmcp 0.14.0 (#6674) [docs] add MCP-UI to MCP Apps blog (#6664) ACP get working dir from args.cwd (#6653) Optimise load config in UI (#6662) Fix GCP Vertex AI global endpoint support for Gemini 3 models (#6187) fix: macOS keychain infinite prompt loop (#6620) chore: reduce duplicate or unused cargo deps (#6630) feat: codex subscription support (#6600) smoke test allow pass for flaky providers (#6638) feat: Add built-in skill for goose documentation reference (#6534) Native images (#6619) docs: ml-based prompt injection detection (#6627) Strip the audience for compacting (#6646) chore(release): release version 1.21.0 (minor) (#6634) add collapsable chat nav (#6649) ...
Summary
Optimise the load time when app starts or new session starts
Reduce the call to check ELEVENLAB_API_KEY exists or not. This call is expensive as takes around 3s because it checks keychain at the backend
Fix getProviders callback memoization in ConfigContext using a ref to prevent unnecessary recreations
Enhanced user experience to show the puzzle of current session extension only after the extensions are loaded.
Type of Change
AI Assistance
Testing
Manual testing by adding sleep in the
/config/readendpointBefore
https://github.com/user-attachments/assets/2818649f-fce3-48de-806f-861de3612d74
After
https://github.com/user-attachments/assets/56546fdc-c722-4d5a-a7b5-5adde2f66b19