fix(pr-reviewer): gate the "ready" ping; stop committing VFS state
Merged
KH
6mo ago+206+206+012345678901234567890123456789-14-14-01234567890123456789
Why
From the review channel: the pr-reviewer was sending duplicate "ready for your review" reminders, pinging PRs that were already merged, and saying ready while checks were still pending. It was also committing a relay VFS state file into every PR.
Changes (review/agent.ts)
- Don't announce a merged/closed PR as ready.
verifyReadyForHumanReviewnow queriesstate,mergeable,mergeStateStatus,reviewDecision,statusCheckRollup(was justmergeable,statusCheckRollup) andprReadyStateAllowsHumanReviewrejects anything notOPEN. - Don't announce ready with pending checks. An empty
statusCheckRollupused to pass vacuously ([].every() === true) — exactly the window where checks are queued but not yet registered. Now empty → not ready. Drafts andCHANGES_REQUESTEDare also held back. So a ping requires: open, no conflicts, not draft, no changes-requested, ≥1 check, all checks complete + passing. - No duplicate reminders for the same commit.
announceReadyOncerecords the head SHA it announced ready for (workspace memory) and won't re-announce it on subsequent webhooks; a genuinely new head SHA still gets a note, threaded under the PR's first Slack message via the existingpostSlackPrUpdatethreading. - Reply to bot/reviewer comments with where they were fixed. The harness prompt now requires an
## Addressed commentssection — one bullet per comment with thefile:lineof the fix (or a reason if skipped). The sandbox has nogh/git and the VFS client only exposes whole-PRcomment/review, so this lands in the posted PR comment. Per-thread in-thread replies are tracked in AgentWorkforce/relayfile-adapters#160.
Also
- Stop committing
memory/workspace/.relay/state.json— relay VFS runtime state rewritten every reconcile cycle, which the review harness kept committing to PRs.git rm --cached+ gitignored.
Tests
npm run test + npm run typecheck green. Added cases for merged/closed, empty rollup, draft, changes-requested, and the addressed-comments prompt requirement.
Related issues
- AgentWorkforce/cloud#1988 — opt-in to larger Daytona sandboxes (the exit-137 OOM failures on big PRs; infra-side, not in this repo).
- AgentWorkforce/relayfile-adapters#160 — github writeback path to reply to an existing PR review-comment thread.
🤖 Generated with Claude Code
Summary by cubic
Fixes noisy “ready for review” pings by gating on PR state and CI, deduping once per head commit with a race-safe reservation, and ignoring Relay VFS state. Adds an “Addressed comments” section with exact file:line locations.
-
Bug Fixes
- Announce ready only when the PR is open, mergeable, not draft, and has no changes requested. Checks must be complete and passing;
SKIPPEDis non-blocking. An empty rollup is ready only when GitHub reportsCLEAN(no-CI repos), otherwise it stays pending. - Send the ready message once per head SHA; populate missing SHAs via
gh pr view --json headRefOid. Use a workspace reservation to choose a single winner across overlapping runs and mark failures/cancellations so a later retry can post. - Stop tracking
memory/workspace/.relay/state.jsonand ignore.relay/andmemory/workspace/.relay/in.gitignore.
- Announce ready only when the PR is open, mergeable, not draft, and has no changes requested. Checks must be complete and passing;
-
New Features
- The review harness now requires an “## Addressed comments” section with one bullet per comment and the exact
file:lineof the fix, or a brief reason if skipped.
- The review harness now requires an “## Addressed comments” section with one bullet per comment and the exact