Skip to content

[Fix] Prevent stale PR review actions#739

Merged
daniel-lxs merged 1 commit into
developfrom
fix/pr-review-offer-races
Jul 23, 2026
Merged

[Fix] Prevent stale PR review actions#739
daniel-lxs merged 1 commit into
developfrom
fix/pr-review-offer-races

Conversation

@daniel-lxs

@daniel-lxs daniel-lxs commented Jul 23, 2026

Copy link
Copy Markdown
Member

Fixes three defects in the PR review offer plumbing on develop:

  1. Offer resurrection raceattachPendingPrReviewActionMessage used GET-then-SET, so an offer claimed by a typed reply in between was silently recreated with live buttons that dispatch the superseded follow-up. The message id is now attached in a single atomic Lua script (KEEPTTL) that no-ops when the record is gone.
  2. Index orphaning raceclaimPendingPrReviewActionsForThread read and deleted the conversation index in separate operations, so offers indexed concurrently were dropped unclaimed and could never be retired by a later reply. The read, clear, and claim now run in one atomic script.
  3. Resume host inheritance — snapshot-resume source-control stamps could inherit the source run's host under an explicitly different provider, resolving repositories against the wrong instance. The host is now only inherited together with the provider.

Includes mocked-Redis tests for both scripts and a DB-backed test for the host inheritance guard.

🤖 Generated with Claude Code

@roomote-roomote

roomote-roomote Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

No code issues found. See task

  • packages/sdk/src/server/lib/task-runs/pr-review-action.ts:166 The 50-iteration cap left additional pending offers indexed and live after a typed reply. The new atomic Lua claim drains the entire conversation index, so no capped remainder remains.

Reviewed 3cbab5b

@daniel-lxs
daniel-lxs marked this pull request as draft July 23, 2026 20:48
@daniel-lxs
daniel-lxs force-pushed the fix/pr-review-offer-races branch from 8dd06e4 to 3cbab5b Compare July 23, 2026 20:56
@daniel-lxs daniel-lxs changed the title [Fix] Close PR review offer races and resume host inheritance edge [Fix] Port stale PR review action fixes to develop Jul 23, 2026
@daniel-lxs
daniel-lxs marked this pull request as ready for review July 23, 2026 20:56
@daniel-lxs
daniel-lxs merged commit 75b4250 into develop Jul 23, 2026
16 checks passed
@daniel-lxs
daniel-lxs deleted the fix/pr-review-offer-races branch July 23, 2026 21:03
@daniel-lxs daniel-lxs changed the title [Fix] Port stale PR review action fixes to develop [Fix] Prevent stale PR review actions Jul 23, 2026
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.

1 participant