Skip to content

fix(server): pull request watch never wakes the agent about a replaced commit - #180

Merged
yordis merged 2 commits into
yordis/feat-watch-instructionsfrom
yordis/fix-watch-wakes-follow-head
Oct 29, 2026
Merged

yordis merged 2 commits into
yordis/feat-watch-instructionsfrom
yordis/fix-watch-wakes-follow-head

Conversation

@yordis

@yordis yordis commented Oct 29, 2026

Copy link
Copy Markdown
Member
  • A wake could describe checks or conflicts for a commit that had already been replaced by a newer push, sending the agent to fix problems that no longer exist.
  • The agent needs to know which commit the findings are about so it can tell stale results from current ones.

@cursor

cursor Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes orchestration watch sweeps and agent wake content; incorrect behavior could miss wakes or send agents to fix obsolete commits, but scope is limited to PR monitoring.

Overview
Fixes pull request watches waking the agent with stale host data or missing conflict news after the PR head moves.

The watch reactor now always invalidates cached PR reads before each planned detail/activity fetch (not only when a watch fingerprint exists), so sweeps do not reuse data from an older push or from a viewer read.

Conflict handling in evaluatePullRequestWatch treats a push as resetting mergeability uncertainty: a conflict on a new head is reported even if the previous head was already conflicting, and unknown mergeability no longer keeps the old head’s conflict flag across a head change.

Wake copy now states which short SHA the findings refer to and tells the agent to confirm the PR head is still that commit before acting. Tests cover invalidate-then-detail when fingerprint is null, conflict-on-replaced-head, the new message line, and reactor mocks that stub invalidate.

Reviewed by Cursor Bugbot for commit 2ea27de. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S labels Oct 29, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 21e8cf5. Configure here.

@yordis
yordis added this pull request to stack #182 October 29, 2026 03:46
@coderabbitai

coderabbitai Bot commented Oct 29, 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 39 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between e46e6db and 2ea27de.

Files selected for processing: 7
  • apps/server/src/orchestration-v2/Orchestrator.ts
  • apps/server/src/orchestration-v2/PullRequestWatchReactor.test.ts
  • apps/server/src/orchestration-v2/PullRequestWatchReactor.ts
  • apps/server/src/orchestration-v2/pullRequestWatch.test.ts
  • apps/server/src/orchestration-v2/pullRequestWatch.ts
  • apps/server/src/orchestration-v2/runtimeLayer.test.ts
  • evals/mcp-tool-use/cases/pull-requests.ndjson
  • 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

Comment @coderabbitai help to get the list of available commands.

…d commit

A cached read or a conflict carried over from an old head sent the agent after findings it had already pushed past.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
A conflict told about a replaced commit says nothing about the new head, so a push that fails to resolve it must be reported again.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis
yordis force-pushed the yordis/fix-watch-wakes-follow-head branch from 21e8cf5 to 2ea27de Compare October 29, 2026 04:08
@yordis
yordis merged commit f3a1e1a into main Oct 29, 2026
11 checks passed
@yordis
yordis deleted the yordis/fix-watch-wakes-follow-head branch October 29, 2026 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant