Skip to content

refactor(cli): scope watcher state per instance - #13243

Merged
marius-kilocode merged 2 commits into
mainfrom
refactor-watcher-service
Aug 20, 2026
Merged

refactor(cli): scope watcher state per instance#13243
marius-kilocode merged 2 commits into
mainfrom
refactor-watcher-service

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

The CLI/TUI watcher keeps the branch label synchronized after an external git switch by warming the location service for Git instances. Its state was still cached through InstanceState.make, which made the watcher lifetime and cleanup harder to reason about and left an architecture ratchet exception in place.

This change keeps the live vcs.branch.updated behavior and client gating, but tracks each warmed location in the watcher service with an instance-owned child scope. Repeated initialization is deduplicated, instance disposal closes the child scope before invalidating the shared location map entry, and service shutdown closes any remaining scopes. The watcher integration tests cover branch updates and per-instance lifecycle isolation.

The shared filesystem watcher, VCS event pipeline, TUI consumer, and /vcs endpoint are unchanged.

@marius-kilocode
marius-kilocode force-pushed the refactor-watcher-service branch from 51fca83 to b8984e4 Compare August 19, 2026 14:21
@marius-kilocode
marius-kilocode merged commit 559f39f into main Aug 20, 2026
60 of 61 checks passed
@marius-kilocode
marius-kilocode deleted the refactor-watcher-service branch August 20, 2026 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants