Skip to content

fix(review): reduce first-feedback latency for newly opened PRs - #1078

Merged
steipete merged 1 commit into
mainfrom
steipete/first-feedback-latency
Aug 9, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/first-feedback-latency

Conversation

@steipete

@steipete steipete commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

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

  1. The webhook posts one action-scoped fast acknowledgment (marker clawsweeper-pr-ack:<action>) after a successful opened/ready_for_review enqueue, idempotent across duplicate deliveries via the existing prune/settle machinery. synchronize and metadata events stay silent.
  2. Brand-new items from opened/ready_for_review bypass the dispatch debounce (extension of isImmediateExactReviewDecision, flag threaded only from the new-item creation path); existing-item coalescing, commands, publications, and scheduled lanes byte-identical.
  3. The eyes reaction moved before the pnpm build in the event review job. The review-started placeholder deliberately stayed put: it invokes the built reserve-lease CLI and its outputs feed retry/publication/finalization steps.

Marker safety: the new marker cannot match numeric command-ack parsing or the review-status:started placeholder 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:unit 1,971 pass / 0 fail; pnpm run check green; coordinator autoreview clean (0.96). New tests: single ack across duplicate deliveries, silent synchronize, first-event immediate scheduling vs preserved debounce, workflow step order.

@steipete
steipete requested a review from a team as a code owner August 9, 2026 04:02
@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:06 AM ET / 04:06 UTC.

ClawSweeper review

What this changes

The 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
Reviewed head: 86ef55ff0c3bbff816da562b15f65b21e7802765

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The design and focused tests are useful, but an actionable webhook-reliability defect and missing real behavior proof block merge readiness.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR reports unit tests and checks, but lacks after-fix production-boundary evidence for the webhook acknowledgement and queue path; provide a redacted trace and omit private endpoints, keys, and IP addresses. 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 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR reports unit tests and checks, but lacks after-fix production-boundary evidence for the webhook acknowledgement and queue path; provide a redacted trace and omit private endpoints, keys, and IP addresses. 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 6 items Current webhook ordering: Current main reserves source authority, verifies the live head, enqueues the item, completes authority, and returns 202; the supplied PR patch inserts the awaited acknowledgement between enqueue and completion.
Queue latency source: Current main applies the 90-second dispatch debounce to newly created queue items unless a command, publication, or scheduled lane makes the decision immediate.
Workflow ordering: Current main runs setup-pnpm before the review-start reaction, matching the latency source described by the PR.
Findings 1 actionable finding [P2] Isolate acknowledgement failures from queued reviews
Security None None.

How this fits together

ClawSweeper’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]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR reports unit tests and checks, but lacks after-fix production-boundary evidence for the webhook acknowledgement and queue path; provide a redacted trace and omit private endpoints, keys, and IP addresses. 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.
  • Isolate acknowledgement failures from queued reviews (P2) - The queue has already accepted the item when this awaited API write runs. If creating or listing the target comment fails transiently, githubWebhook rejects and returns a failed delivery even though the review is durable; catch and log this best-effort acknowledgement failure, then continue with source-authority completion and the 202 response.
  • Resolve merge risk (P1) - A transient target-comment API failure can now make the webhook request fail after the review was already accepted by the queue, producing avoidable delivery retries and obscuring the fast acknowledgement’s best-effort role.
  • Resolve merge risk (P1) - The PR body reports test and check results but has no controlled after-fix webhook/queue trace, so the claimed seconds-level acknowledgement and immediate eligibility remain unproven on the current head.
  • Resolve merge risk (P1) - The PR changes review lifecycle, queue, and workflow behavior without stating whether OpenClaw Bay is affected or why no Bay update is needed.
  • Complete next step (P2) - The contributor must repair the non-fatal webhook boundary, supply real behavior proof, and document Bay impact; those current-head tasks cannot be safely handed off as an automated repair.

Findings

  • [P2] Isolate acknowledgement failures from queued reviews — dashboard/worker.ts:1267
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Code and test delta production +107/-26, tests +255/-1 across 5 files The production growth is concentrated in webhook acknowledgement and queue scheduling, while the added tests cover the intended paths but not the non-fatal failure boundary.

Merge-risk options

Maintainer options:

  1. Make the acknowledgement non-fatal (recommended)
    Catch and log target-comment acknowledgement failures so an already queued review still returns the normal webhook success response.
  2. Pause the latency change
    Close or defer the PR if the acknowledgement cannot be made best-effort while preserving the intended user signal.

Technical review

Best 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:

  • [P2] Isolate acknowledgement failures from queued reviews — dashboard/worker.ts:1267
    The queue has already accepted the item when this awaited API write runs. If creating or listing the target comment fails transiently, githubWebhook rejects and returns a failed delivery even though the review is durable; catch and log this best-effort acknowledgement failure, then continue with source-authority completion and the 202 response.
    Confidence: 0.91

Overall correctness: patch is incorrect
Overall confidence: 0.85

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 095f5c5a9492.

Labels

Label changes:

  • add P2: This is a bounded operational review-latency improvement with an introduced webhook-reliability defect.
  • add merge-risk: 🚨 automation: The patch changes webhook and Actions workflow behavior that can affect review dispatch and visible feedback after merge.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • 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 reports unit tests and checks, but lacks after-fix production-boundary evidence for the webhook acknowledgement and queue path; provide a redacted trace and omit private endpoints, keys, and IP addresses. 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 operational review-latency improvement with an introduced webhook-reliability defect.
  • merge-risk: 🚨 automation: The patch changes webhook and Actions workflow behavior that can affect review dispatch and visible feedback after merge.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR reports unit tests and checks, but lacks after-fix production-boundary evidence for the webhook acknowledgement and queue path; provide a redacted trace and omit private endpoints, keys, and IP addresses. 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 webhook ordering: Current main reserves source authority, verifies the live head, enqueues the item, completes authority, and returns 202; the supplied PR patch inserts the awaited acknowledgement between enqueue and completion. (dashboard/worker.ts:1260, 095f5c5a9492)
  • Queue latency source: Current main applies the 90-second dispatch debounce to newly created queue items unless a command, publication, or scheduled lane makes the decision immediate. (dashboard/exact-review-queue.ts:1315, 095f5c5a9492)
  • Workflow ordering: Current main runs setup-pnpm before the review-start reaction, matching the latency source described by the PR. (.github/workflows/sweep.yml:855, 095f5c5a9492)
  • Patch-specific failure path: The supplied PR patch awaits the new target-comment acknowledgement after a non-null queue response without a failure boundary; existing GitHub token calls reject on unsuccessful responses. (dashboard/worker.ts:1267, 86ef55ff0c3b)
  • Feature history: Recent history shows Peter Steinberger carrying the webhook, queue, and workflow review paths, with Martin Cleary and Vincent Koc contributing adjacent dashboard and queue changes. (dashboard/worker.ts:1138, 095f5c5a9492)
  • Branch availability limitation: The checkout is clean at current main, but the partial clone could not materialize the supplied PR head because the GitHub remote was unavailable; the review used the supplied affected hunks and current-main source. (095f5c5a9492)

Likely related people:

  • Peter Steinberger: Recent commits cover the webhook, queue, and review-workflow paths central to this change. (role: recent area contributor; confidence: high; commits: 095f5c5a9492, 81c23bede7a8, 4d48e9918b9b; files: dashboard/worker.ts, dashboard/exact-review-queue.ts, .github/workflows/sweep.yml)
  • Martin Cleary: Recent dashboard lifecycle and Bay work overlaps the Worker’s review-publication path. (role: adjacent dashboard contributor; confidence: medium; commits: 80720568fa82, ddae19e06391; files: dashboard/worker.ts)
  • Vincent Koc: Recent queue and workflow changes overlap the queue scheduling surface affected by the first-event bypass. (role: recent queue contributor; confidence: medium; commits: 2a61adcc1f06, daf339e6d1d3; files: dashboard/exact-review-queue.ts, .github/workflows/sweep.yml)

Rank-up moves

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

  • Catch and log acknowledgement API failures after queue acceptance.
  • Add a redacted Crabbox local-container trace showing one opened-pull-request acknowledgement and immediate queue eligibility at this head.
  • State whether OpenClaw Bay is unaffected, or update its observer data and proof.

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 1ab4350 into main Aug 9, 2026
17 checks passed
@steipete
steipete deleted the steipete/first-feedback-latency branch August 9, 2026 04:10
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