Skip to content

Bug: Vim .swp files in .roo/rules/ directory crash rules loadingΒ #4317

@KJ7LNW

Description

@KJ7LNW

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

  1. Open any file in the .roo/rules/ directory using vim (e.g., vim .roo/rules/01-prettier-tree-sitter.md)
  2. While vim is still open (and the .swp file exists), try to use Roo with rules
  3. Observe that rules loading is assumed to have crashed when it encounters the .swp file due to missing content by going to Prompts->Preview and 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

Issue - In ProgressSomeone is actively working on this. Should link to a PR soon.bugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions