Skip to content

fix(review): acknowledge pull requests at webhook receipt - #1079

Merged
steipete merged 1 commit into
mainfrom
steipete/ack-at-receipt
Aug 9, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/ack-at-receipt

Conversation

@steipete

@steipete steipete commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Follow-up to #1078, driven by a production miss: openclaw/openclaw#120874 (opened 04:15:08Z) received no fast acknowledgment. The #1078 ack ran only after a successful enqueue — below the "head verification deferred" catch (which a single throttled GitHub read triggers, and throttle cycles are routine) and the stale-head return. Any event taking those paths acknowledged nothing.

The Fix

The acknowledgment moves to event receipt: posted immediately after webhook classification for opened/ready_for_review, before source-authority reservation, head verification, and enqueue. Semantics now match the copy — "Pull request received" — true regardless of what verification later decides. Same marker, idempotency, prune, and settle machinery; ack failures are caught so the webhook flow never degrades.

Proof

  • New tests: deferred-verification path posts exactly one ack; stale-head path acks before its response; failed ack write leaves enqueue untouched; happy-path, duplicate-delivery, and synchronize behavior unchanged from fix(review): reduce first-feedback latency for newly opened PRs #1078.
  • Dashboard worker 325/325; full pnpm test:unit 1,971 pass / 0 fail; pnpm run check 3,207 pass; coordinator autoreview clean (0.99).

Note: the #120874 event may also have suffered an ingress-delivery gap (no dispatcher run fired either — plausibly Actions-trigger suppression for a service-account author); the App webhook delivery log check is tracked separately. This change hardens the code path that is ours regardless.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. labels Aug 9, 2026
@clawsweeper

clawsweeper Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 9, 2026, 12:46 AM ET / 04:46 UTC.

ClawSweeper review

What this changes

This PR moves the pull-request receipt acknowledgement ahead of source-head verification and review-queue admission, while retaining the existing acknowledgement marker and cleanup behavior.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked until real behavior proof from a real setup is added - 4 items remain

The patch narrowly fixes the reported acknowledgement gap, but it needs required real-behavior proof and an OpenClaw Bay impact statement before merge.

Priority: P2
Reviewed head: be149400cd3111acd75e2dc1cd52661b00252080

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The targeted patch and focused coverage look sound, but real-behavior proof remains a merge gate.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR body reports mocked Worker tests and checks, but lacks after-fix behavior proof through a real webhook or approved production-boundary harness; redact any sensitive trace details. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body reports mocked Worker tests and checks, but lacks after-fix behavior proof through a real webhook or approved production-boundary harness; redact any sensitive trace details. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 5 items Current-main gap: Current main posts the acknowledgement only after successful queue admission, so deferred verification and stale-head returns occur before the acknowledgement call.
Branch repair: The branch invokes the acknowledgement immediately after item classification and catches write failures before verification, reservation, and enqueue.
Focused coverage: The updated Worker test covers deferred verification, stale heads, acknowledgement-write failure, sequential duplicate delivery, and silent synchronize events.
Findings None None.
Security None None.

How this fits together

The dashboard Worker receives GitHub pull-request webhooks, verifies the live source head, and adds eligible work to the exact-review queue. The fast acknowledgement comment provides immediate visible feedback before the review workflow starts.

flowchart LR
  A[GitHub pull request webhook] --> B[Webhook classification]
  B --> C[Receipt acknowledgement]
  C --> D[Live head verification]
  D --> E[Exact review queue]
  E --> F[Review workflow]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body reports mocked Worker tests and checks, but lacks after-fix behavior proof through a real webhook or approved production-boundary harness; redact any sensitive trace details. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The PR body has test-only evidence rather than the required controlled real-behavior proof for this Worker webhook change.
  • Resolve merge risk (P1) - The PR body does not state whether OpenClaw Bay is affected, as required for lifecycle and review-publication changes.
  • Complete next step (P2) - No mechanical repair is needed; the contributor must provide current-head real behavior proof and the required Bay impact statement.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production versus test delta production +7/-3, tests +82/-20 Most of the change is focused coverage for the newly acknowledged early-exit paths.

Root-cause cluster

Relationship: canonical
Canonical: #1079
Summary: This PR is the focused remaining repair for an acknowledgement gap left by the earlier first-feedback change.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Add current-head behavior proof (recommended)
    Record a redacted controlled webhook trace at the PR head that forces deferred verification or a stale head and shows exactly one receipt acknowledgement, then state the OpenClaw Bay impact.
  2. Pause pending proof
    Keep this PR unmerged until the runtime behavior and Bay impact can be demonstrated.

Technical review

Best possible solution:

Keep the early acknowledgement ordering, then add a redacted production-boundary or Crabbox local-container trace proving acknowledgement precedes a forced verification failure and record whether Bay is unaffected or update its proof.

Do we have a high-confidence way to reproduce the issue?

Yes for source reproduction: current main returns from deferred verification and stale-head handling before the acknowledgement call, and the branch test exercises both paths. No real webhook trace has been supplied.

Is this the best way to solve the issue?

Yes: emitting a receipt acknowledgement before verification is the narrowest way to make the message truthful across both early exits, provided the runtime proof confirms the intended behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 1ab4350383c2.

Labels

Label changes:

  • add P2: This is a bounded reliability repair to review-intake feedback rather than an outage of the review system.
  • add merge-risk: 🚨 automation: The patch changes the Worker webhook automation path that posts acknowledgement comments and feeds review intake.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports mocked Worker tests and checks, but lacks after-fix behavior proof through a real webhook or approved production-boundary harness; redact any sensitive trace details. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: This is a bounded reliability repair to review-intake feedback rather than an outage of the review system.
  • merge-risk: 🚨 automation: The patch changes the Worker webhook automation path that posts acknowledgement comments and feeds review intake.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports mocked Worker tests and checks, but lacks after-fix behavior proof through a real webhook or approved production-boundary harness; redact any sensitive trace details. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Current-main gap: Current main posts the acknowledgement only after successful queue admission, so deferred verification and stale-head returns occur before the acknowledgement call. (dashboard/worker.ts:1267, 1ab4350383c2)
  • Branch repair: The branch invokes the acknowledgement immediately after item classification and catches write failures before verification, reservation, and enqueue. (dashboard/worker.ts:1201, be149400cd31)
  • Focused coverage: The updated Worker test covers deferred verification, stale heads, acknowledgement-write failure, sequential duplicate delivery, and silent synchronize events. (test/dashboard-worker.test.ts:25901, be149400cd31)
  • Feature provenance: The current acknowledgement behavior arrived with the merged first-feedback implementation, which is the directly related earlier change. (dashboard/worker.ts:1267, 1ab4350383c2)
  • Proof status: The PR body reports unit tests and checks, but contains no after-fix real webhook or production-boundary trace.

Likely related people:

  • steipete: The merged current-main implementation of fast pull-request acknowledgement is commit 1ab4350, and this PR follows up on that same Worker path. (role: introduced the current acknowledgement behavior; confidence: high; commits: 1ab4350383c2; files: dashboard/worker.ts, test/dashboard-worker.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add a redacted current-head Crabbox local-container or production-boundary trace for a forced deferred-verification or stale-head event.
  • State whether OpenClaw Bay is affected and include its proof if it is.
  • Request a fresh review after updating the PR body with that evidence.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 06bc47a into main Aug 9, 2026
17 checks passed
@steipete
steipete deleted the steipete/ack-at-receipt branch August 9, 2026 04:53
steipete added a commit that referenced this pull request Aug 9, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. P2 Normal priority bug or improvement with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant