Skip to content

fix(chat): back off Antigravity Windows lock scans while a lock changes hands - #2760

Merged
devswha merged 2 commits into
mainfrom
fix/issue-2051
Nov 4, 2026
Merged

devswha merged 2 commits into
mainfrom
fix/issue-2051

Conversation

@devswha

@devswha devswha commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Fixes #2051

Change

Follow-ups from #2016 (Antigravity chat on Windows):

  • No backoff when a lock changes hands during a scan. When a pane's lock ownership moved between the scan and its confirmation, windowsHeldPaths invalidated the scan and returned without recording the pid's retry backoff, so a lock that kept flipping caused a full Restart Manager pass over every conversation lock on every refresh. That pid now backs off on the same 5/10/20/40/60 s schedule as any other unresolved pid. It still returns [] (nothing is proven), and the backoff still resets when the lock listing changes.
  • RmGetList's holder cap gets its own constant, MAX_WINDOWS_HOLDERS, instead of reusing MAX_WINDOWS_CANDIDATES (same value).
  • windowsLockCandidates reads its one root directly instead of looping over a one-item Set.
  • Two agy-store.test.ts tests now remove their mkdtemp dirs (this machine had 140 leftover /tmp/agy-store-* dirs).

Not changed, as listed in the issue:

  • Checking a real Antigravity session on native Windows needs a signed-in Antigravity account.
  • A lock file whose query always fails still resolves nothing until the listing changes (intended: a failed query proves nothing).
  • invalidateWindowsScan() still drops another pane's scan in progress. That only wastes work: the interrupted pass restarts itself and its waiters get the fresh result.
  • The @kyop21 credit is already in CHANGELOG.md (folded with feat(chat): support Antigravity chat on Windows via Restart Manager #2016).

Validation

  • New test backs off a pid whose lock keeps changing hands during every scan: on origin/main 7a923ab it fails (21 full scans in 21 polls, expected < 15); with the fix it passes.
  • bun test server/agy-store.test.ts: 19 pass.
  • bun run check fast: ok (typecheck, build, unit 11085 pass / 0 fail).
  • Not run: native Windows (server/windows-native.test.ts is untouched; the Native Windows CI job covers it).

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 5 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 7a923ab and 8df7e32.

Files selected for processing: 3
  • changelog.d/agy-windows-moving-lock-backoff.md
  • server/agy-store.test.ts
  • server/agy-store.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@devswha

devswha commented Nov 4, 2026

Copy link
Copy Markdown
Owner Author

Review round 1 (omo + Codex Terra), fixed in 8df7e32:

  • MEDIUM (Codex, reproduced by both): after a moving lock, a changed lock listing kept the old backoff, because the scan it would compare against had been invalidated. A changed listing now restarts the delay at 5 s. Test: starts the backoff over after a moving lock settles through a new lock file.
  • MEDIUM (Codex, reproduced): a pid resolved through another pane's scan kept its backoff entry, so a later lock switch waited up to 60 s. Resolving a lock now drops the pid's backoff entry. Test: starts the backoff over after a moving lock settles through another pane's scan.
  • LOW (omo): the moving-lock test now asserts the exact scan times (0, 6, 18, 42, 84 s) instead of an upper bound.

Both new tests fail on 297dee3 and pass on 8df7e32. bun test server/agy-store.test.ts: 21 pass. bun run check fast passed on the fix (unit 11087 pass, 0 fail). The last commit only tightened one assertion, after which the test file and bun run typecheck were re-run.

@devswha

devswha commented Nov 4, 2026

Copy link
Copy Markdown
Owner Author

Review round 2 (omo, CLEAR at 8df7e32). Left for later, not fixed here:

  • MEDIUM, pre-existing (identical on main 7a923ab): a second pane whose lock switches on every poll keeps producing fresh shared scans, and a pid whose lock is moving reads those scans past its own backoff. It costs extra Restart Manager calls (3 per poll in the repro) and never gives a wrong answer. A possible fix is to check the pid's backoff entry before rescanning when its singleton confirmation fails.
  • LOW, intended: a pane whose lock really moved while a scan was running now waits at least 5 s to resolve, instead of resolving on the next refresh.

CodeRabbit skipped this PR (review limit).

@devswha

devswha commented Nov 4, 2026

Copy link
Copy Markdown
Owner Author

Merge note: merged on the omo review (CLEAR at 8df7e32), Codex Terra (reproduced MEDIUMs fixed; the same-on-main MEDIUM and an intended LOW are listed above) and green checks. CodeRabbit was rate-limited. #2051 stays open for item 1 (needs a real Windows Antigravity session).

@devswha
devswha merged commit bc45a32 into main Nov 4, 2026
23 checks passed
@devswha
devswha deleted the fix/issue-2051 branch November 4, 2026 13:17
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.

Antigravity Windows chat: follow-ups from #2016

1 participant