-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
When editing files in the .roo/rules/ directory with vim, the temporary .swp files created by vim cause the rules loading process to crash. The application fails to properly handle these binary files, resulting in incomplete rules loading.
Version
- App version: 3.16.5
- API Provider: n/a
Expected behavior
The application should not crash when encountering binary files or temporary files in the rules directory.
Steps to reproduce
- Open any file in the
.roo/rules/directory usingvim(e.g.,vim .roo/rules/01-prettier-tree-sitter.md) - While
vimis still open (and the.swpfile exists), try to use Roo with rules - Observe that rules loading is assumed to have crashed when it encounters the
.swpfile due to missing content by going toPrompts->Previewand then scroll to the bottom or click the copy button.
Error examples
When a vim .swp file exists
# Rules from ~/src/prettier-tree-sitter/.roo/rules/.01-prettier-tree-sitter.md.swp:
b0VIM 8.2
<content from 01-prettier-tree-sitter.md is missing>
After closing vim (no .swp file)
# Rules from ~/src/prettier-tree-sitter/.roo/rules/01-prettier-tree-sitter.md:
...
# Rules from ~/src/prettier-tree-sitter/.roo/rules/02-more-rules.md:
...
With multiple files, files before the .swp file load correctly
# Rules from ~/src/prettier-tree-sitter/.roo/rules/.00:
foo
# Rules from ~/src/prettier-tree-sitter/.roo/rules/.01-prettier-tree-sitter.md.swp:
b0VIM 8.2
Additional context
The issue only affects rules loading when .swp files are present. Once vim is closed and the .swp files are removed, rules load correctly.
Files before the .swp file (alphabetically) are loaded correctly, but processing stops at the .swp file.
No stack trace was found in developer tools, so additional debugging information is not available.
Suggested fix: Ignore files that start with . when reading the rules directory.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status