Repository navigation
fix(indexing): replace chokidar file watcher with @parcel/watcher #12784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
marius-kilocode
merged 10 commits into
Kilo-Org:main
from
mavrukin:fix/indexing-file-watcher-ready-timeout
Sep 2, 2026
Merged
Changes from 4 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
61ec24d
fix(indexing): prevent indefinite hang in file watcher initialization
mavrukin 07b082e
fix(indexing): replace chokidar file watcher with @parcel/watcher
mavrukin 0a12bda
fix(indexing): degrade gracefully when the native watcher is unavailable
mavrukin 3b4cc06
fix(indexing): prune gitignored dirs from the watch and harden subscr…
mavrukin f15f88b
fix(indexing): skip watcher prune globs for glob-metachar ignore dirs
mavrukin 1d267c6
fix(indexing): guard '!' in watcher prune globs and simplify the parc…
mavrukin 9d83843
Merge branch 'main' into fix/indexing-file-watcher-ready-timeout
mavrukin c4834a1
Merge branch 'main' into fix/indexing-file-watcher-ready-timeout
mavrukin d9c94b7
fix(indexing): preserve incremental watcher updates
marius-kilocode 1da932b
Merge branch 'main' into fix/indexing-file-watcher-ready-timeout
marius-kilocode File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@kilocode/kilo-indexing": patch | ||
| --- | ||
|
|
||
| Fix code index hanging at "Initializing file watcher…": replace the chokidar watcher with @parcel/watcher so subscribing no longer blocks the bundled runtime, prune ignored and per-repo gitignored directories from the native watch so large repositories don't exhaust OS file-watch limits, and fall back to a full scan (incremental updates disabled) when the native watcher can't start instead of failing indexing. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WARNING: A subscription that resolves after
shutdown()/dispose()is leaked and keeps feedingaccumulatedEventsNeither
shutdown()nordispose()awaitsthis.ready, andthis.subscriptionis stillundefinedwhile a subscribe is in flight. If indexing is cancelled (orstopWatcher()runs) whilesubscribeFnis still pending — possible for up toPARCEL_SUBSCRIBE_TIMEOUT_MSon a pathological backend — the late resolution lands here and stores a live native subscription on an already-disposed watcher. Nothing ever unsubscribes it, and its events keep hittinghandleFileEvent, which appends toaccumulatedEvents(line 322) even when not collecting — unbounded growth in a long-lived extension host. Worse,dispose()resetsthis.ready, so a laterinitialize()starts a second subscribe; when both resolve, this assignment overwrites the first and leaks it permanently.Consider capturing the pending promise (
const ready = ...) and only storing the subscription when it is still current (if (this.ready === ready) ... else void subscription.unsubscribe()), or awaitingthis.readyinshutdown()before tearing down.Reply with
@kilocode-bot fix itto have Kilo Code address this issue.