Skip to content

Conversation

@hannesrudolph
Copy link
Collaborator

@hannesrudolph hannesrudolph commented Aug 22, 2025

Reverts #7203 temporarily as it breaks existing modes import functionality.


Important

Reverts loading modes from multiple files in .roo/roo_modes directory, restoring original mode loading behavior in CustomModesManager.ts.

  • Reversion:
    • Reverts loading modes from multiple files in .roo/roo_modes directory in CustomModesManager.ts.
    • Removes loadModesFromDirectory() and related logic.
    • Simplifies mode loading to only use .roomodes and settings files.
  • Tests:
    • Removes tests related to .roo/modes directory in CustomModesManager.spec.ts.
    • Updates tests to reflect reversion to original mode loading behavior.

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

Copilot AI review requested due to automatic review settings August 22, 2025 18:34
@hannesrudolph hannesrudolph requested a review from mrubens as a code owner August 22, 2025 18:34
@hannesrudolph hannesrudolph requested review from cte and jr as code owners August 22, 2025 18:34
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. bug Something isn't working labels Aug 22, 2025
Copy link
Contributor

Copilot AI left a 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 reverts a feature that enabled loading Roo modes from multiple files in the .roo/roo_modes directory. The revert is temporary due to breaking existing modes import functionality.

  • Removes support for loading modes from .roo/modes directory files
  • Reverts to simpler precedence model with only settings and .roomodes files
  • Removes associated test cases and directory watching functionality

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/core/config/tests/CustomModesManager.spec.ts Removes test cases for .roo/modes directory functionality and updates precedence expectations
src/core/config/CustomModesManager.ts Removes directory-based mode loading, simplifies file watching, and reverts to two-file precedence model

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

sourceFile: filePath,
}))
// Add source to each mode
return result.data.customModes.map((mode) => ({ ...mode, source }))
Copy link

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

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

The removal of the sourceFile property may break functionality that depends on tracking which file a mode originated from. This could impact mode updates and deletions that need to modify the correct source file.

Suggested change
return result.data.customModes.map((mode) => ({ ...mode, source }))
// Add source and sourceFile to each mode
return result.data.customModes.map((mode) => ({ ...mode, source, sourceFile: filePath }))

Copilot uses AI. Check for mistakes.
const existingMode = existingModes.find((m) => m.slug === slug)

const isProjectMode = config.source === "project"
let targetPath: string
Copy link

Copilot AI Aug 22, 2025

Choose a reason for hiding this comment

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

The logic for determining the target file for mode updates has been simplified but may not correctly handle existing modes. Without the sourceFile property, the system cannot track where an existing mode was originally loaded from, potentially causing modes to be written to the wrong file.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

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

Thank you for the PR! I've reviewed the revert and have some concerns about the approach. While I understand there's a breaking issue with the modes import functionality, a full revert may impact users who have already adopted the multi-file feature. I've left some suggestions inline to help improve the implementation.

sourceFile: filePath,
}))
// Add source to each mode
return result.data.customModes.map((mode) => ({ ...mode, source }))
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with Copilot's concern here. Removing the sourceFile property could break functionality that depends on tracking which file a mode originated from. This is particularly important for the update and delete operations.

Is this removal necessary for fixing the breaking issue, or could we preserve this property while addressing the specific problem?

const existingMode = existingModes.find((m) => m.slug === slug)

const isProjectMode = config.source === "project"
let targetPath: string
Copy link
Contributor

Choose a reason for hiding this comment

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

The simplified logic here may cause modes to be written to the wrong file. Without tracking the original source file, when a user updates a mode that was loaded from .roomodes, it might incorrectly be saved to the global settings file or vice versa.

Could we at least preserve the logic to check where the mode originally came from before deciding where to save updates?

for (const mode of settingsModes) {
modesMap.set(mode.slug, mode)
}
const roomodesModes = roomodesPath ? await this.loadModesFromFile(roomodesPath) : []
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we're removing support for .roo/modes directories, should we add a warning or migration notice for users who might have already created these directories? They'll suddenly find their modes aren't being loaded without any explanation.

Consider adding a check for these directories and logging a deprecation warning.

@roomote
Copy link
Contributor

roomote bot commented Aug 22, 2025

Additional Review Comments

Missing Context About the Breaking Issue:
The PR description mentions that the feature "breaks existing modes import functionality" but doesn't provide:

  • Specific details about what is broken
  • Steps to reproduce the issue
  • Link to a bug report or issue tracking this problem

This makes it difficult to verify if a full revert is the best solution. Could you provide more context about the specific breaking issue? This would help determine if a targeted fix might be more appropriate than a complete revert.

Alternative Approaches to Consider:

  1. Feature Flag: Keep the multi-file loading feature but disable it by default until the issue is resolved
  2. Targeted Fix: Address the specific breaking issue while preserving the feature for users who need it
  3. Migration Path: If reverting is necessary, provide a tool or documentation to help users migrate their .roo/modes files back to the single-file format

Timeline and Tracking:
Since this is marked as a "temporary" revert, it would be helpful to:

  • Create a tracking issue for re-implementing this feature properly
  • Provide an estimated timeline for when the feature will be restored
  • Document the known issues that need to be addressed

This would help set expectations for users who were relying on this feature per issue #7202.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 22, 2025
@mrubens mrubens merged commit 7137c19 into main Aug 22, 2025
20 of 21 checks passed
@mrubens mrubens deleted the revert-7203-feature/multiple-roo-mode-files branch August 22, 2025 18:44
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Aug 22, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Aug 22, 2025
roomote bot pushed a commit that referenced this pull request Aug 28, 2025
- Add support for loading modes from .roo/modes directory (both global and project)
- Implement proper precedence: project .roo/modes > .roomodes > global .roo/modes > settings
- Update file watchers to monitor .roo/modes directories
- Preserve original source file when updating modes
- Add comprehensive tests for the new functionality
- Support both .yaml and .yml file extensions

This re-implements the feature that was reverted in #7332, addressing the issue
reported by @farazoman where YAML files in $HOME/.roo/modes were not loading.

Fixes #7202
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 size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants