Ignore rules go stale, and nested .gitignore files are ignored
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- tooling
Research direction
Start with the ignore-rule cache in src/main/tools/workspace.ts:95-115, then trace invalidation through edit_file, write_file, apply_patch, undo in chat_manager.ts:142, and the separate CodeIndex workspace. Reproduce the nested-ignore case with pkg/.gitignore excluding dist/ and check how listFiles feeds grep, list_directory, glob, and embeddings. Done when changed and nested ignore rules are honored across these paths and the issue’s stale-rule scenarios are covered by tests.
Written by the indexing model from the issue text.
Description
Found in the 2026-10-07 code review and confirmed with probes.
Problem
Workspace caches its ignore rules (src/main/tools/workspace.ts:95-115):
edit_filenever callsinvalidateIgnoreRules(onlywrite_fileandapply_patchdo).- Undo invalidates a new
Workspace(chat_manager.ts:142), not the cached one, so it has no effect. - Changes made by
run_command, the user orgit checkoutare never picked up during a session. CodeIndexkeeps its ownWorkspaceinstance, and nothing ever invalidates its rules.- Only the root
.gitignore/.ccignoreare read. Nested.gitignorefiles and.git/info/excludeare ignored. Probe:pkg/.gitignorewithdist/still listedpkg/dist/bundle.js.
Impact
grep, list_directory, glob and the embeddings index include build output in monorepos, which wastes tokens and embedding money. Files the user just ignored are still shown.
Fix
- Key the cache on the
mtimeMsof each ignore file and re-read when one changes (onestatper call). - Load nested
.gitignorefiles duringlistFiles, scoped to their folder, or usegit ls-files -co --exclude-standardwhen.gitexists.
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 2
- Avg merge
- 5h 28m
- Merged PRs (30d)
- 24
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PierrunoYT/patch
-
enhancement platform: windows priority: low severity: low
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PierrunoYT/patch#198 ·
Maintainers usually reply within 1 day
-
priority: medium security severity: low
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
PierrunoYT/patch#66 ·
Maintainers usually reply within 1 day
-
bug platform: macos priority: low severity: low tests
Difficulty 3/5 1-2 days Newbie friendliness 56/100
PierrunoYT/patch#218 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement priority: low security severity: low
Difficulty 4/5 3-5 days Newbie friendliness 55/100
PierrunoYT/patch#211 · 2 comments ·
Maintainers usually reply within 1 day
-
enhancement platform: windows priority: low security severity: low
Difficulty 4/5 3-5 days Newbie friendliness 55/100
PierrunoYT/patch#207 ·
Maintainers usually reply within 1 day
All issues in PierrunoYT/patch
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 84/100
answerLoops/answerLoops#345 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
siyuan-note/siyuan#20313 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
LanternOps/breeze#8254 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
gofish-graphics/gofish-graphics#1084 ·
Maintainers usually reply within 1 day