Skip to content

Refresh Workspace Changes on agent disk writes - #18

Merged
adamhulme merged 1 commit into
mainfrom
agent/review-disk-write-refresh
Jul 24, 2026
Merged

Refresh Workspace Changes on agent disk writes#18
adamhulme merged 1 commit into
mainfrom
agent/review-disk-write-refresh

Conversation

@adamhulme

Copy link
Copy Markdown
Collaborator

Problem

Terminal agents write files straight to disk, which fires no onDidSaveTextDocument event and matches neither the image nor the plan watcher. Workspace Changes therefore only self-corrected on the 10-second poll, so an agent's edits looked stale in Review for up to 10s.

Change

  • Add a general **/* workspace watcher in ReviewTreeProvider. Disk-write events route through the cheap git-only refreshChanges() path on their own 250ms debounce — not the full findFiles refresh — since a source edit can only move git state. Plans/docs and images keep their dedicated watchers.
  • Filter build/dependency churn (node_modules, .git, out, dist), mirroring the findFiles excludes, so agent write bursts don't pin the refresh pipeline.
  • Invalidate verification evidence for the changed URI, matching what the save handler already does, so freshness signatures stay honest for on-disk edits.
  • Known limitation (documented in the code): string-glob watchers only cover workspace folders, so agents in worktrees outside the workspace still rely on the 10s poll.
  • Add .nvmrc (Node 24) to document the contributor toolchain — deliberately not engines.node, which would ship a false runtime claim in the extension manifest (the extension host runs Node ~20 at VS Code 1.96, and the notify hook helper only needs node:http).

Testing

  • npm run check — lint clean, 220/220 unit tests pass.

🤖 Generated with Claude Code

Terminal agents edit files directly on disk, which fires no
onDidSaveTextDocument event, so Workspace Changes stayed stale until the
10s poll. Add a general workspace watcher that routes through the cheap
git-only refreshChanges path on a 250ms debounce and invalidates
verification evidence like the save handler does. Worktrees outside the
workspace still rely on the poll.

Document the contributor Node version in .nvmrc instead of engines.node,
which would ship a false runtime claim in the extension manifest.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@adamhulme
adamhulme merged commit 2f3267b into main Jul 24, 2026
7 checks passed
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.

1 participant