Skip to content

Conversation

elianiva
Copy link

@elianiva elianiva commented Oct 4, 2025

Related GitHub Issue

Closes: #8122

Roo Code Task Context (Optional)

Description

Upon setting custom storage path, custom modes didn't show up. This PR fixes it by replacing hardcoded global storage path to the one set by the user.

Test Procedure

  1. Set custom global storage path
  2. Create a new mode
  3. Restart, it should still show the custom modes we've defined earlier in the custom directory.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Documentation Impact: I have considered if my changes require documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Screenshots / Videos

Documentation Updates

Additional Notes

Get in Touch

@elianiva


Important

Fixes issue with custom modes not showing by using user-defined storage path instead of hardcoded path.

  • Behavior:
    • Replaces hardcoded global storage path with user-defined path in createModeInstructions() in create-mode.ts and getModesSection() in modes.ts.
    • Ensures settings directory is created using ensureSettingsDirectoryExists() in modes.ts.
  • Utilities:
    • Updates ensureSettingsDirectoryExists() in globalContext.ts to use getSettingsDirectoryPath() for custom path handling.
    • Modifies migrateSettings() in migrateSettings.ts to use getSettingsDirectoryPath() for determining settings directory.

This description was created by Ellipsis for 9e93dd8. You can customize this summary. It will automatically update as commits are pushed.

@elianiva elianiva requested review from cte, jr and mrubens as code owners October 4, 2025 05:36
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels Oct 4, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Oct 4, 2025
Copy link

@roomote roomote bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found a couple of small follow-ups to improve correctness and maintainability.


try {
const settingsDir = path.join(context.globalStorageUri.fsPath, "settings")
const settingsDir = await getSettingsDirectoryPath(context.globalStorageUri.fsPath)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Using getSettingsDirectoryPath() here will create the settings directory before the existence check below. That makes the early-return branch ("No settings directory found, no migrations necessary") unreachable. Consider removing the existence check/log or computing the path without side effects before checking, so logs reflect actual conditions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[BUG] Custom storage path not used for custom modes (global YAML ignored)

2 participants