Repository navigation
fix(review): reduce first-feedback latency for newly opened PRs - #1078
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 9, 2026, 12:06 AM ET / 04:06 UTC. ClawSweeper reviewWhat this changesThe PR adds a fast acknowledgement for newly opened or ready pull requests, makes their first review queue attempt immediate, and moves the review-start eyes reaction before dependency setup. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 6 items remain Keep this PR open: it addresses a real current-main latency path, but the new required acknowledgement can turn a successful enqueue into a failed webhook delivery when the target-comment write is transiently unavailable. The PR also needs the repository-required controlled real-behavior proof and an explicit OpenClaw Bay impact statement before landing. Priority: P2 Review scores
Verification
How this fits togetherClawSweeper’s dashboard Worker accepts GitHub pull-request webhooks, verifies the live head, and puts work into the exact-review queue. A separate event-review workflow later claims that work and writes visible review progress back to the target pull request. flowchart LR
A[GitHub pull request event] --> B[Webhook Worker]
B --> C[Live head verification]
C --> D[Exact review queue]
D --> E[Event review workflow]
E --> F[Comment and eyes reaction]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Make the acknowledgement explicitly best-effort after a successful enqueue, record whether Bay is unaffected or update its observer data if needed, and attach a redacted Crabbox production-boundary trace that demonstrates one acknowledgement and immediate first-event eligibility. Do we have a high-confidence way to reproduce the issue? No high-confidence live reproduction was available: current source confirms the debounce and workflow ordering, and the supplied patch exposes the acknowledgement failure path, but the PR head could not be materialized locally for a controlled run. Is this the best way to solve the issue? No: the latency approach is narrow, but the acknowledgement must not be able to fail an already accepted webhook delivery; isolate that write as best-effort before treating this as the maintainable fix. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 095f5c5a9492. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
…1082) * fix(webhook): grant pull request fast-ack tokens pull_requests write The PR receipt fast ack minted its installation token with pull_requests: read, but posting a comment on a pull request through the issues API requires pull_requests: write for App tokens. GitHub answered 403 Resource not accessible by integration, the ack threw, and between PR #1078 and #1079 that uncaught throw returned HTTP 500 to every pull_request opened/ready_for_review webhook delivery (outage window 2026-08-09 04:12-04:52Z); after #1079 the same failure was swallowed silently, so no PR ever received its receipt comment. Also mint App installation tokens with the documented repositories parameter instead of repository_names, which GitHub ignores - tokens were silently granted installation-wide repository_selection=all instead of being scoped to the named repository. Log swallowed fast-ack failures so the next regression is visible in wrangler tail. * docs: reference PR number in changelog entries
What Problem This Solves
A newly opened PR on a target repo got no visible reaction for 4–9 minutes and no substantive review for 8–30. Three measured causes: the App-webhook ingress enqueued within seconds but posted no acknowledgment (fast-ack machinery was wired only to slash-commands); the 90-second dispatch debounce applied fully to an item's first-ever event, though there is nothing to coalesce on a brand-new PR (while scheduled backfill items skip the debounce entirely); and the eyes reaction ran only after checkout, pnpm build, and Codex/OpenClaw setup despite being a pure API write.
The Fix
clawsweeper-pr-ack:<action>) after a successfulopened/ready_for_reviewenqueue, idempotent across duplicate deliveries via the existing prune/settle machinery.synchronizeand metadata events stay silent.opened/ready_for_reviewbypass the dispatch debounce (extension ofisImmediateExactReviewDecision, flag threaded only from the new-item creation path); existing-item coalescing, commands, publications, and scheduled lanes byte-identical.Marker safety: the new marker cannot match numeric command-ack parsing or the
review-status:startedplaceholder recovery marker; existing command ack text unchanged.Effect
First visible acknowledgment: webhook-time (~seconds) instead of 4–9 minutes. Review dispatch eligibility 90 seconds earlier. No queue priority, feed rate, token, or lease changes.
Proof
Dashboard worker 325/325; full
pnpm test:unit1,971 pass / 0 fail;pnpm run checkgreen; coordinator autoreview clean (0.96). New tests: single ack across duplicate deliveries, silent synchronize, first-event immediate scheduling vs preserved debounce, workflow step order.