Skip to content

git watcher: a lost FSEvent leaves the change line stale (no fallback; re-check at turn end) #908

Done

Description

@SSFSKIM

What's wrong

The git status watcher (src/services/git/watcher.ts) learns of a worktree change only through its FSEvent watch. When an event is lost or late, as it is on the mini with its degraded fseventsd, the panel's change line stays stale until the next write lands in the same worktree. #891 gave every other watch-only path a 2 s stat fallback (branch arch/watch-fallbacks). It left this one alone because no cheap stat sees a write anywhere in a worktree, and a periodic git status per root costs too much at 2 s.

Evidence

e2e/panel.spec.ts:748 ("a second edit to an already-dirty file updates the change line") waits for git.changed after a write to a tracked file that is already dirty. It went red once on the mini host on 2026-11-28 at 20:10Z and was green on rerun (CI-opt's reading).

The work

Re-check git status at the moments a change is likely, rather than on a timer. Proposed: when a session's turn ends, run one git status for the watched roots under that session's cwd. Optionally, also run one after a tool call that edits a file. Bound it so a burst of turn ends doesn't fan out.

Add a unit test that drops the watch event and shows the change line refresh at the turn end.

Activity

  1. added
    bug
    status:ready-for-implementer
    priority:P3
    on Nov 29, 2026
  2. SSFSKIM commented on Nov 29, 2026

    @SSFSKIM
    OwnerAuthor

    Second sighting, 2026-11-29 ~04:47Z: e2e/code-tools.spec.ts:2388 (G4: an open filter follows a new file) red at :2402 on the mini host (CI-opt's a891-groups at 3378e49). The Go to file list refreshes on a change to the working folder's git status set (finder.ts:25). That set comes from this watcher, so a lost FSEvent leaves the new file out for longer than the test's 30 s wait.

  3. added
    status:in-progress
    and removed
    status:ready-for-implementer
    on Nov 29, 2026
  4. SSFSKIM commented on Nov 29, 2026

    @SSFSKIM
    OwnerAuthor

    [board] in-progress: master-landing-architect dispatches a builder

  5. removed
    status:in-progress
    on Nov 29, 2026
  6. SSFSKIM commented on Nov 29, 2026

    @SSFSKIM
    OwnerAuthor

    [board] done: landed on master 3af493f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority:P3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions