Skip to content

Conversation

@roomote
Copy link
Collaborator

@roomote roomote commented Jun 30, 2025

Fixes #5180 - Mode selector missing after update due to empty .roomodes files causing schema validation errors.

Enhanced CustomModesManager to handle empty/malformed .roomodes files gracefully by detecting empty files and initializing them with proper structure, preventing 'customModes: Required' errors.


Important

Enhances CustomModesManager to handle empty or malformed .roomodes files by initializing them with default content and improving error handling.

  • Behavior:
    • CustomModesManager now handles empty .roomodes files by initializing them with a default structure using createDefaultRoomodesContent().
    • Enhances parseYamlSafely() to return an empty object for empty or whitespace-only content and handle null results from YAML parser.
    • Attempts to fix malformed .roomodes files by writing default content if schema validation fails due to customModes type issues.
  • Functions:
    • Adds createDefaultRoomodesContent() to generate default YAML content for .roomodes files.
    • Modifies loadModesFromFile() to initialize empty .roomodes files with default content.
    • Updates getCustomModesFilePath() and resetCustomModes() to use createDefaultRoomodesContent().
  • Logging:
    • Adds logging for empty content detection and attempts to fix malformed files in CustomModesManager.

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

- Detect empty .roomodes files and initialize with proper structure
- Handle malformed files by attempting automatic repair
- Ensure consistent default content creation across all methods
- Maintain backward compatibility with existing functionality
- Prevent 'customModes: Required' errors for users with empty files
@roomote roomote requested review from cte, jr and mrubens as code owners June 30, 2025 09:07
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Jun 30, 2025
@delve-auditor
Copy link

delve-auditor bot commented Jun 30, 2025

No security or compliance issues detected. Reviewed everything up to 08adc06.

Security Overview
  • 🔎 Scanned files: 1 changed file(s)
Detected Code Changes

The diff is too large to display a summary of code changes.

Reply to this PR with @delve-auditor followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jun 30, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jul 7, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 7, 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 Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Mode selector is missing after 06/26/25 update.

3 participants