Repository navigation
Re-create failed worktree watchers and stop reinspecting on every read - #1555
Merged
Merged
Conversation
milanb17
force-pushed
the
mb/issue-1548-investigation-38fdd2
branch
2 times, most recently
from
November 19, 2026 19:47
3aa45ab to
005cf32
Compare
One watcher error, or a failed subscribe, marked a live worktree unhealthy for good. Every refresh tick and GET then re-ran a full inspection (git ls-files plus an lstat per working file) for every live board on it, until the app restarted. A worktree with a missing watcher now reuses its last inspection for ten seconds. The next read after that subscribes again and then inspects, so a watcher that comes back costs one inspection and one that cannot costs one every ten seconds. Watcher failures are logged. Closes #1548. Agent-Session: f5bf6b6e-2f61-4a5d-a234-befeae23de4d Agent-Session: 33d99bfe-0d11-4a51-86b9-0a2f51551005
milanb17
force-pushed
the
mb/issue-1548-investigation-38fdd2
branch
from
November 19, 2026 20:17
005cf32 to
7f46f87
Compare
milanb17
enabled auto-merge (squash)
November 19, 2026 20:23
thesiti92
approved these changes
Nov 19, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #1548.
Problem
A live worktree's cached inspection was reused only while its watchers were healthy. One watcher error (or a failed
subscribe) marked the worktree unhealthy and dropped the subscription, and nothing ever resubscribed or cleared the flag. From then on every 1 s refresh pass and every GET re-ran a full inspection (git calls plus anlstatof every working file) for every live board on that worktree, until the app restarted.Change
A worktree is either watched or not:
A watcher error only drops the subscription. There is no retry timer or backoff: resubscribing happens as part of the 10 s check, so a watcher that keeps failing is bounded by the same rule. Watcher failures are now logged; they were silent before.
Measured
One live board on a 3,000-file repository, refreshed once a second, with a watcher error injected at 10 s. Figures are for the 30 s after the error; CPU is the server process only.
Trade-offs
Testing
The existing "continues capturing after watchers fail" test now also checks that repeated refreshes after a watcher error run no inspection. The case where resubscribing keeps failing has no automated test. Typecheck and lint pass. Not reproduced in a running Desktop.