fix: respect custom storage path for global custom modes #8127
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.
This PR addresses Issue #8122 where custom storage paths were not being respected when resolving global custom modes files.
Problem
When a custom storage path is configured via
roo-cline.customStoragePath, the extension was still looking for global custom modes in the default location instead of the configured path.Root Cause
The
ensureSettingsDirectoryExists()function was building the settings path directly fromcontext.globalStorageUri.fsPath + "settings", bypassing the custom storage logic ingetSettingsDirectoryPath().Solution
Updated
ensureSettingsDirectoryExists()to delegate togetSettingsDirectoryPath(), which properly honors theroo-cline.customStoragePathsetting.Changes
ensureSettingsDirectoryExists()to usegetSettingsDirectoryPath()getSettingsDirectoryPath()for displaying correct path in help textgetSettingsDirectoryPath()for consistent custom path handlingImpact
With this fix, when
roo-cline.customStoragePathis set to/Users/SOMEBODY/.roo:/Users/SOMEBODY/.roo/settings/custom_modes.yaml/Users/SOMEBODY/.roo/settings/mcp_settings.json.roomodesbehavior remains unchangedTesting
Acceptance Criteria (from issue)
roo-cline.customStoragePathto an absolute pathcustom_modes.yamlat<customPath>/settings/custom_modes.yamlFixes #8122
Thanks to @hannesrudolph for the excellent bug analysis and suggested fix!
Important
Fixes issue where custom storage paths were ignored for global custom modes by updating path handling functions to use
getSettingsDirectoryPath().roo-cline.customStoragePathwas ignored for global custom modes.ensureSettingsDirectoryExists()inglobalContext.tsto usegetSettingsDirectoryPath().createModeInstructions()increate-mode.tsto usegetSettingsDirectoryPath()for correct path display.migrateSettings()inmigrateSettings.tsto usegetSettingsDirectoryPath()for consistent path handling.roo-cline.customStoragePathis set..roomodesbehavior remains unchanged.This description was created by
for 8348e12. You can customize this summary. It will automatically update as commits are pushed.