-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix code index secret persistence and improve settings UX #5158
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
Merged
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
|
✅ No security or compliance issues detected. Reviewed everything up to e6df6a3. Security Overview
Detected Code ChangesThe diff is too large to display a summary of code changes. Reply to this PR with |
Contributor
|
you may have a look at the refactoring here #5314 |
86b6376 to
beb1de4
Compare
- Add async secret methods to CodeIndexConfigManager - Implement direct VSCode secret storage access bypassing ContextProxy cache - Update loadConfiguration to use async secret loading - Modify webview message handler to use new async secret storage - Add public secret methods to CodeIndexManager - Enhance debugging throughout secret flow This fixes the issue where API keys were saved but not loaded immediately into services due to ContextProxy cache synchronization issues.
- Add async secret handling to CodeIndexConfigManager with new methods: - getSecretAsync(), storeSecretAsync() for individual secrets - loadSecretsAsync(), storeSecretsAsync() for batch operations - Update doesConfigChangeRequireRestart() to check OpenAI Compatible modelDimension changes - Fix all failing tests by using setupSecretMocks() helper consistently - Update manager.spec.ts to properly mock _recreateServices to avoid real service creation This ensures API keys and other secrets are properly loaded from VSCode's async secret storage and that configuration changes requiring service restart are correctly detected.
- Show placeholder dots (••••••••••••••••) in password fields when secrets are already set - Only send modified secret fields to prevent overwriting existing secrets with empty values - Track which fields have been modified by the user - Add requestCodeIndexSecretStatus message handler to check if secrets exist - Fix console.log to handle empty string keys without errors - Ensure changing one setting doesn't clear other unmodified secrets
- Rename handleExternalSettingsChange to handleSettingsChange for clarity - Remove handleSettingsChange call from ClineProvider (not related to code index) - Remove codebaseIndexConfig from general settings save in SettingsView - Delete unused codebaseIndexConfig message handler - Remove codebaseIndexConfig from WebviewMessage type definition - Code index settings are now fully independent with their own dedicated UI
- Move 'Enable codebase indexing' toggle to global settings in Experimental section - Keep indexing-specific settings (API keys, URLs, models) in dedicated Code Index Settings component - Add codebaseIndexEnabled handler to webview message handler - Update translations with new settings title and disabled message - Ensure code index service properly responds to enable/disable changes - Maintain backward compatibility with existing codebaseIndexConfig structure
…ntext directly - Updated CodeIndexConfigManager to accept vscode.ExtensionContext in constructor - Modified CodeIndexManager to pass context directly to CodeIndexConfigManager - Updated webviewMessageHandler to use provider.context.secrets directly - Removed getVSCodeContext() method from ContextProxy - Updated all related tests to reflect these changes - Fixed CodeIndexSettings webview tests after UI changes
…ilizing ContextProxy directly
…dexSettings tests
…Manager, CodeIndexServiceFactory, and QdrantVectorStore
- Add advancedConfigLabel, searchMinScoreLabel, searchMinScoreDescription, searchMinScoreResetTooltip keys - Update startIndexingButton and clearIndexDataButton labels to match main - Preserve all CodeIndexPopover translations added in this PR
This reverts commit beb1de4924ac1475731fcd06d994ddb96eb1e5fd.
- Added codeIndex.advancedConfigLabel - Added codeIndex.searchMinScoreLabel - Added codeIndex.searchMinScoreDescription - Added codeIndex.searchMinScoreResetTooltip These keys exist on main but were missing from non-English locales after rebase.
… up translation key inconsistencies
…ove secret handling
…ConfigManager and webviewMessageHandler
54a5333 to
a4f9ba9
Compare
mrubens
approved these changes
Jul 3, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
lgtm
This PR has been approved by a maintainer
PR - Needs Review
size:XXL
This PR changes 1000+ lines, ignoring generated files.
UI/UX
UI/UX related or focused
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.
Summary
This PR addresses two main areas:
## Key Changes
1. Fixed Secret Persistence and Configuration Handling
refreshSecrets()method inContextProxyto ensure that the application always has the latest secrets from VSCode's secret storage.CodeIndexConfigManagernow refreshes secrets before loading a new configuration, ensuring that any new API keys are immediately available.CodeIndexManagernow correctly recreates services when settings are changed, ensuring that the new configuration is applied.2. Improved Settings UI/UX
CodeIndexPopovercomponent has been introduced to manage provider-specific settings, accessible from the chat input's status badge. This keeps the settings in context and easily accessible.3. Translation Cleanup
webview-ui/src/i18n/locales/*/settings.jsonhave been standardized to use theopenAi(camelCase with capital 'A') naming convention.Screenshots
Testing
Related Issues