Skip to content

Rules symlinked from other folders are read in seemingly random order, not alphabeticalΒ #4131

@dsent

Description

@dsent

App Version

3.19.0

API Provider

Not Applicable / Other

Model Used

N/A

πŸ” Steps to Reproduce

  1. Create symlinks to a few text files from other folder in .roo/rules
  2. Open Roo's Modes, select any mode.
  3. Click "Preview System Prompt"
  4. Observe that the inclusion order is not alphabetical (despite the documentation).

πŸ’₯ Outcome Summary

Judging by the comments
# Rules from ...
in the system prompt preview, I don't see any obvious order.
Moreover, the order is different each time.
Paths to the target files, not symlinks, are listed.

I believe that the correct way to handle this is to sort symlinks in the same way that normal files are sorted. The symlink name (not the name it points to) should be used for sorting.

Symlinking files from elsewhere and naming symlinks is a standard pattern for e.g. scripts to ensure execution order, while keeping particular files in sync between multiple folders they're referred in.

This might be a Windows-specific problem.

πŸ“„ Relevant Logs or Errors (Optional)

Sample excerpt from the System Prompt preview (repo path stripped):

# Rules from <skipped>\.roo\_rules\lang.yaml:
<skipped>
# Rules from <skipped>\.roo\_rules\shell.yaml:
<skipped>
# Rules from <skipped>\.flow\config\project-brief.yaml:
<skipped>
# Rules from <skipped>\.roo\_rules\repo-guide.yaml:
<skipped>
# Rules from <skipped>\.roo\_rules\markdown.yaml:
<skipped>


After closing and opening Settings again, the order is different:

# Rules from <skipped>\.roo\_rules\markdown.yaml:
<skipped>
# Rules from <skipped>\.flow\config\project-brief.yaml:
<skipped>
# Rules from <skipped>\.roo\_rules\shell.yaml:
<skipped>
# Rules from <skipped>\.roo\_rules\lang.yaml:
<skipped>
# Rules from <skipped>\.roo\_rules\repo-guide.yaml:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue - Needs ScopingValid, but needs effort estimate or design input before work can start.bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions