Repository navigation
fix(watch): preserve watches when promotion fails - #957
yiheng-kkk wants to merge 1 commit into
Conversation
|
Thank you for this PR. I tested it on its own base and merged with staging. On its own base, your fix works. The bug in #927 was real. But staging already fixed #927 in #988. That fix keeps the old watches until the new one works. It also waits 30 seconds before it tries again. It marks the watcher as degraded while it waits. Your change conflicts with #988 in code_review_graph/incremental.py. Your test also expects the opposite of #988. It wants degraded to be False and a retry on the next tick. So I will not merge this one. Thank you again for your help. |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the watch-promotion recovery change.
No open issues 🎉
What changed in this PR
This PR addresses #927 by preserving existing filesystem watches when recursive promotion fails, allowing the watch supervisor to retry on a later tick.
Changes:
- Register the recursive replacement before releasing existing watches, restoring supervisor state if registration fails.
- Return promotion success to the adoption caller and add regression coverage for failure preservation and successful retry.
| File | Description |
|---|---|
tests/test_watch_robustness.py |
Tests that failed promotion preserves watches and a later retry succeeds. |
code_review_graph/incremental.py |
Makes watch promotion recoverable and propagates its success status. |
Review effort: Balanced
Linked issue
Closes #927
What & why
A failed recursive promotion currently releases the parent and descendant watches before the replacement is registered. Register the replacement first, restore the prior supervisor state when scheduling fails, and report the attempted directory as unadopted so a later tick can retry.
How it was tested
The watcher suite passed 57 tests on Python 3.13 and 3.10. Ruff, mypy, and Bandit passed.
The full suite completed with 2,985 passed, 9 skipped, 2 xpassed, and one unrelated token-budget failure in
get_affected_flows_tool; the same failure reproduces on the unmodified base commit.Checklist