Skip to content

fix(lifecycle): stop a deduped CI nudge from starving review/merge-conflict nudges#2403

Open
abhay-codes07 wants to merge 1 commit into
AgentWrapper:mainfrom
abhay-codes07:fix/pr-nudge-lane-starvation
Open

fix(lifecycle): stop a deduped CI nudge from starving review/merge-conflict nudges#2403
abhay-codes07 wants to merge 1 commit into
AgentWrapper:mainfrom
abhay-codes07:fix/pr-nudge-lane-starvation

Conversation

@abhay-codes07

Copy link
Copy Markdown

Closes #2400.

What

ApplyPRObservation drives three independent nudge lanes for a PR (CI failure, review feedback, merge conflict), each with its own dedup key. Each lane did return m.sendOnce(...), but sendOnce returned nil for both a real send and a dedup / attempt-cap no-op. So while a PR's CI stayed failing on the same commit (a normal multi-poll state), the CI lane deduped to a no-op yet still returned — and the review-feedback and merge-conflict lanes below were never reached. A reviewer's "please fix" nudge was silently suppressed for as long as CI was red.

Change

Make sendOnce report whether it actually sent ((bool, error)), and have each lane return early only on a real send or an error, falling through to the next lane on a dedup no-op. This preserves the one-nudge-per-tick priority for a fresh CI failure while letting independent review/merge-conflict feedback through once the CI nudge is already delivered and deduping. The other sendOnce callers ignore the new bool.

Tests

  • Added TestPRObservation_ReviewNudgeNotStarvedByDedupedCI: CI fails (nudge feat: implement web dashboard with attention-zone UI and API routes #1), then CI unchanged + a new review comment → the review nudge must still fire. Fails before the change (only 1 nudge), passes after.
  • go test ./internal/lifecycle/... green; go vet and gofmt clean.
  • I couldn't run go test -race locally (no 64-bit CGO toolchain on my box) — leaving that to CI.

cc @harshitsinghbhandari — the independent dedup keys made me read the lanes as intended-independent; happy to adjust if the priority was meant to be strict.

…nflict nudges

ApplyPRObservation drives three independent nudge lanes (CI failure, review
feedback, merge conflict), each with its own dedup key. Each lane did
`return m.sendOnce(...)`, but sendOnce returned nil for both a real send and a
dedup/attempt-cap no-op. So while a PR's CI stayed failing on the same commit
(a normal multi-poll state), the CI lane deduped to a no-op yet still returned,
and the review-feedback and merge-conflict lanes below were never reached. A
reviewer's "please fix" nudge was silently suppressed for as long as CI was red.

Make sendOnce report whether it actually sent (bool), and have each lane return
early only on a real send or error, falling through to the next lane on a dedup
no-op. This preserves the one-nudge-per-tick priority for a fresh CI failure
while letting independent review/merge-conflict feedback through once the CI
nudge is already delivered and deduping. Other sendOnce callers ignore the new
bool. Adds a regression test covering the deduped-CI-then-new-review case.
Copilot AI review requested due to automatic review settings July 4, 2026 06:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

bug(lifecycle): a deduped CI-failure nudge starves the review and merge-conflict nudges

2 participants