Roo-Code/src/shared
Daniel e508eaf3df
Fix code index secret persistence and improve settings UX (#5158)
* Fix code index secret persistence with async VSCode storage

- 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.

* Fix code index secret persistence and test failures

- 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.

* feat: improve code index settings secret handling in UI

- 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

* refactor: disconnect code index from unified settings system

- 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

* feat: separate code index enable/disable from indexing settings

- 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

* refactor: remove ContextProxy.getVSCodeContext() and pass ExtensionContext 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

* refactor: streamline secret handling by removing async methods and utilizing ContextProxy directly

* feat: translations and popover component

* refactor: simplify test mocks and improve checkbox handling in CodeIndexSettings tests

* refactor: remove debug logging from CodeIndexConfigManager, CodeIndexManager, CodeIndexServiceFactory, and QdrantVectorStore

* fix: merge missing translation keys from main after rebase

- Add advancedConfigLabel, searchMinScoreLabel, searchMinScoreDescription, searchMinScoreResetTooltip keys
- Update startIndexingButton and clearIndexDataButton labels to match main
- Preserve all CodeIndexPopover translations added in this PR

* Revert "fix: merge missing translation keys from main after rebase"

This reverts commit beb1de4924ac1475731fcd06d994ddb96eb1e5fd.

* fix: add missing translation keys from main branch after rebase

- 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.

* fix: remove clickIndicatorMessage, fix toggle message type, and clean up translation key inconsistencies

* refactor: streamline settings management in CodeIndexPopover and improve secret handling

* refactor: remove debug logging from configuration checks in CodeIndexConfigManager and webviewMessageHandler

* fix: translations

* refactor: remove CodeIndexSettings component and associated tests
2025-07-03 18:33:20 -04:00
..
__tests__ feat: change default mode to architect for new installations (#5289) 2025-06-30 17:46:56 -04:00
api.ts fix context length for lmstudio and ollama (#2462) (#4314) 2025-06-20 22:53:04 -04:00
array.ts Initial streaming refactor 2024-10-09 01:49:54 -04:00
checkExistApiConfig.ts Remove Gemini CLI provider (#5223) 2025-06-28 23:48:28 -04:00
combineApiRequests.ts Add a new @roo-code/types package and use it everywhere (#3912) 2025-05-26 12:06:45 -07:00
combineCommandSequences.ts feat(mcp): improve mcp with McpExecution, make UX like terminal execute (#3485) 2025-06-12 00:46:07 -04:00
context-mentions.ts feat: Allow escaping of context mentions (#4362) 2025-06-12 11:49:19 -04:00
cost.ts Yield the cost in usage data for Anthropic (#4849) 2025-06-18 11:59:11 -07:00
embeddingModels.ts feat: add Gemini embedding provider for codebase indexing (#5228) 2025-07-02 23:51:42 -04:00
experiments.ts Fixes #4882: Remove experimental setting for command execution in attempt_completion (#4884) 2025-06-20 17:48:01 -04:00
ExtensionMessage.ts Fix code index secret persistence and improve settings UX (#5158) 2025-07-03 18:33:20 -04:00
getApiMetrics.ts Add a new @roo-code/types package and use it everywhere (#3912) 2025-05-26 12:06:45 -07:00
globalFileNames.ts Use yaml as default custom modes format (#3749) 2025-05-20 16:44:29 -04:00
language.ts feat: Indonesian translation (#4672) 2025-06-13 20:25:05 -04:00
mcp.ts feature: add toggle for disable mcp server tool from prompt (#3551) 2025-06-20 19:14:59 -04:00
modes.ts Fix #5294: Prevent Architect mode from providing time estimates (#5295) 2025-07-01 09:42:46 -04:00
package.ts Add a new @roo-code/types package and use it everywhere (#3912) 2025-05-26 12:06:45 -07:00
ProfileValidator.ts Roo Code Cloud (#4069) 2025-05-28 20:43:30 -07:00
safeJsonParse.ts feat: vertex/gemini prompt caching (#2996) 2025-04-28 15:11:35 -07:00
support-prompt.ts Fix linter errors (#3821) 2025-05-21 23:16:43 -07:00
TelemetrySetting.ts Add telemetry and privacy policy 2025-03-07 03:03:44 -05:00
tools.ts Fixes #4882: Remove experimental setting for command execution in attempt_completion (#4884) 2025-06-20 17:48:01 -04:00
vsCodeSelectorUtils.ts Prettier backfill 2025-01-17 14:11:28 -05:00
WebviewMessage.ts Fix code index secret persistence and improve settings UX (#5158) 2025-07-03 18:33:20 -04:00