Repository navigation
fix(server): a PR watch reports a comment's edit once per head - #36329
juliusmarminge wants to merge 10 commits into
Conversation
…y edit The watch dated a remark by `editedAt ?? createdAt`, so each edit of one bot status comment woke the agent again as "new comments". Hold an edit of a remark the agent already saw until a read finds it unchanged, then wake once and say it was edited. A held edit forces the next sweep to reread remarks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…pages Cached review-thread tails survive an edit, because neither the comment count nor the top-level watermark changes. The confirming read could then report a stale held edit as settled. Drop cached tails while a watch holds an edit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eads Watching a pull request again now carries the held edit forward, so the settled text still reaches the agent. A watch holding an edit also drops cached activity before reading, even without a host fingerprint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tch was stopped Watching again starts remarksThrough at the restart, so a held comment edited while the watch was stopped looked old and its hold was dropped. A held comment with a new edit is now held again at that edit and delivered once it settles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A bot that keeps rewriting one comment on the same head woke the agent once per rewrite. CodeRabbit, while a review is rate limited, rewrites its walkthrough with a countdown every few minutes; each rewrite stays unchanged for longer than a sweep, so each was held, found settled and delivered. CI status comments rewritten per job do the same. The watch now records the remarks whose edit it reported on the current head and neither holds nor reports their later edits until the head moves. The first edit after a push still wakes, so a bot that re-reviews a push by editing its summary is reported (#15282). A remark new to the watch, and other remarks' first edits, are unaffected. Watching again keeps the record, like the other news the last watch told; watches saved before the field load unchanged.
…ead's report Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r a longer settle Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Other scenariosAll 64 scenario measurements match All 64 scenario measurements
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This change batches repeated PR-comment edits before notifying the agent and preserves pending edits across watch restarts. Its effects are limited to notification timing and host reads, with no new host-side writes or access changes. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
The automated pipeline stopped on this pull request and will not merge it: the fix is written and reviewed, but proving it needs something no worker has:
It stays open for a person to finish or close. |
A PR watch holds an edit of a remark the agent already saw until a read finds it unchanged, then wakes once with the final text. The review finding was correct: the once-per-head rule (remarkEditsTold) dropped every later edit of a remark already reported on that head, so a review bot's 'reviewing' -> 'finished' after a push delivered only 'reviewing'. Instead of removing remarkEditsTold (which would leave nothing beyond #30674's settle delay), an edit of a remark already reported on this head is now held like any other edit, and delivered once its editedAt is TOLD_EDIT_SETTLE_MS (10 minutes) old. That is longer than a bot's countdown rewrites, so a countdown stays quiet until it stops and then wakes once with its final text, while a finished review on the same head still reaches the agent. A remark's first edit on a head still settles after one unchanged read, and the record still resets after a push. Tradeoffs: the final text of an already-reported remark arrives about 10 minutes after the bot's last edit, and while such an edit is held the reactor re-reads each 2-minute sweep even under a quiet host fingerprint. The per-head regression test is rewritten around timed reads to cover the countdown, a second remark, the reviewer's reviewing -> finished sequence after a push, and the earlier old-head held-edit case; it fails on the previous code.
Fixes #30342
Supersedes #36280. The change is @royalaid's; their commits are kept.
Reproduction on main
Evidence
Being captured: before and after in the real app. This section is filled in before the pull request can merge.
Tests
vp test run apps/server/src/orchestration-v2/pullRequestWatch.test.ts: the new test fails on f6f3323's evaluator (final edit never reported); 42/42 pass with the fix. vp run check:changed: format, lint, knip, graphql, typecheck (37 packages) and tests (8 files) all pass, after formatting the test and making the new constant module-private because knip flagged its export as unused.
Not in this change
Who did the work
Run by the t3code factory in T3 Code.