Skip to content

fix(cli): hear an edit made beside a running task of its project - #5331

Open
Exelord wants to merge 2 commits into
mainfrom
claude/project-thread-8qy6yu
Open

Exelord wants to merge 2 commits into
mainfrom
claude/project-thread-8qy6yu

Conversation

@Exelord

@Exelord Exelord commented Nov 18, 2026

Copy link
Copy Markdown
Member

vx watch no longer drops an edit made during its first run while another task of the same project was running.

Before

vx watch lint build: lint is done (a hit, or finished), build of the same project still runs, you save a file lint reads. Watch arms, prints watching, and runs nothing: lint's output stays built from the old bytes until the next save. Reproduced on 0.0.657 in a plain workspace at every moment of the build.

After

The loop arms, sees the file was written inside a command's window, takes the keys again, finds lint's moved, and runs a cycle on the file.

How it works

The first run has no watcher, so the arm scans the files git lists as dirty and written since the run started. One written while a command of its own project ran was skipped: it may be that command's own write. Now those files are kept aside, and when there are any and no cycle is already coming, a keys-only plan (no store asked, nothing printed) is compared with the keys the first run took. A moved key means a task was built from bytes the tree no longer holds, and the files become events. The check holds running, so an event meanwhile queues as it does behind a cycle.

A start where the first run's commands wrote no dirty file inside a window pays nothing new.

Breaking changes

None.

Proof

tests/watch-initial-edit-done.test.ts:

  • "an edit to a finished task, made while another task of its project runs, starts a cycle" times out without the fix.
  • CONTROL "a file the initial run wrote in its own project starts no cycle": fails when the key check is forced to say "moved", so it does reach the check.

Found by the workday probe with the watcher killed and restarted (seed 42); seeds 42 to 44 pass on this branch.


Generated by Claude Code

vx watch's first run has no watcher, and a file written while a command
of its own project ran was taken for that command's. An edit to a task
already keyed (a hit, or done) then waited for the next save. The keys
tell the two apart: taken again once the loop arms, one that moved
makes those files changes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W6xuYbJ4nYmSNRHVnNwVx2
Under VX_DEBUG_TIMING the keys-only plan printed a stage table of its
own, which read as a cycle's (tests/watch-timing.test.ts).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W6xuYbJ4nYmSNRHVnNwVx2

This branch has not been deployed

No deployments
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