Skip to content

feat(dispatch): acknowledge pull request receipt from the target dispatcher - #1080

Merged
steipete merged 1 commit into
mainfrom
steipete/dispatcher-pr-ack
Aug 9, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/dispatcher-pr-ack

Conversation

@steipete

@steipete steipete commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Production evidence (four consecutive organic PRs on openclaw/openclaw, post-#1079) shows the Worker-webhook fast-ack never fires for PR events — the GitHub App appears not to deliver pull_request webhooks (delivery-log verification tracked separately, needs App admin). Meanwhile the target-repo dispatcher workflow demonstrably fires within seconds of PR open. Contributors still see nothing until the review job's eyes reaction, minutes later.

The Fix

The dispatcher posts the receipt acknowledgment itself: a new step in the clawsweeper-dispatch workflow (live copy and the canonical template in docs/target-dispatcher.md, byte-identical, with a test enforcing that), gated to non-draft opened/ready_for_review, minting a minimal issues:write App token, continue-on-error, placed before review dispatch. It posts the exact Worker marker (clawsweeper-pr-ack:<action>) and body, and skips if any marker comment already exists — idempotent against duplicate runs and against the webhook route whenever it comes back to life.

Target repos pick this up when their dispatcher copy is updated from the template (openclaw/openclaw propagation is a separate PR).

Proof

Full pnpm test:unit 1,973 pass / 0 fail; pnpm run check 3,209 pass; coordinator autoreview clean (0.99). New tests: gating, marker/body exactness, placement, permissions, continue-on-error, live/template byte-parity.

@steipete
steipete requested a review from a team as a code owner August 9, 2026 05:18
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. 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, 1:21 AM ET / 05:21 UTC.

ClawSweeper review

What this changes

The PR adds an idempotent target-dispatcher step that posts an early receipt acknowledgement for newly opened or ready-for-review pull requests.

Merge readiness

⛔ Blocked until real behavior proof is added - 8 items remain

Keep this PR open: it fills a distinct target-dispatcher fallback not present in current main, but its marker lookup can be spoofed by any commenter and misses markers beyond the first comments page. It also needs inspectable after-fix workflow evidence before merge.

Priority: P2
Reviewed head: 6fbe38d76d2ce343ae0ac2bae134f15ac736b18c

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The fallback is focused and documented, but it has two correctness gaps and lacks required real behavior proof.
Proof confidence 🧂 unranked krab (1/6) Needs real behavior proof before merge: The PR reports tests and production observations but provides no inspectable after-fix dispatcher run, receipt comment, or redacted trace; add one after the code fixes and request a fresh review. 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) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR reports tests and production observations but provides no inspectable after-fix dispatcher run, receipt comment, or redacted trace; add one after the code fixes and request a fresh review. 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 4 items PR marker lookup trusts unverified comments: The new dispatcher treats any comment containing the public marker prefix and item suffix as an existing acknowledgement, without checking the comment author; a PR author can post that marker and suppress the intended receipt comment.
Current Worker establishes the safe lookup pattern: Current main accepts acknowledgement markers only from the ClawSweeper GitHub App and scans up to five pages; the PR's new workflow omits both protections.
Current receipt behavior provenance: The current Worker receipt acknowledgement was introduced by the merged receipt-at-event change, so this PR is a fallback for missing target-webhook delivery rather than an already-implemented dispatcher change.
Findings 2 actionable findings [P2] Validate acknowledgement markers against the ClawSweeper App
[P2] Paginate the acknowledgement-marker lookup
Security Needs attention Untrusted comments can suppress the App acknowledgement: The marker scan does not verify the author, unlike the current Worker implementation, so any PR participant can create the marker that prevents the App from posting its receipt.

How this fits together

The target dispatcher receives GitHub pull-request events in each target repository, optionally posts a receipt comment, then sends the item to ClawSweeper for review. The existing Worker webhook path posts the same receipt comment when webhook delivery is available.

flowchart LR
  A[Pull request event] --> B[Target dispatcher]
  A --> C[Worker webhook]
  B --> D[Receipt marker lookup]
  C --> E[Worker marker lookup and cleanup]
  D --> F[Receipt comment]
  E --> F
  B --> G[Exact review dispatch]
  G --> H[Review result]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR reports tests and production observations but provides no inspectable after-fix dispatcher run, receipt comment, or redacted trace; add one after the code fixes and request a fresh review. 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.
  • Validate acknowledgement markers against the ClawSweeper App (P2) - This check accepts any PR comment with the public marker text. A contributor can post &lt;!-- clawsweeper-pr-ack:opened item=&lt;number> --> before the workflow runs, causing the dispatcher to skip the receipt message. Current main's Worker lookup filters matching markers to the ClawSweeper App sender; apply the same boundary here.
  • Paginate the acknowledgement-marker lookup (P2) - The lookup fetches only the first 100 comments. If a draft accumulates more than 100 comments before ready_for_review, its acknowledgement can be on page two; a workflow retry then cannot see it and posts a duplicate despite the idempotence claim. Current main scans multiple pages for this marker.
  • Resolve security concern: Untrusted comments can suppress the App acknowledgement - The marker scan does not verify the author, unlike the current Worker implementation, so any PR participant can create the marker that prevents the App from posting its receipt.
  • Resolve merge risk (P1) - A public marker comment can suppress the receipt acknowledgement, and a marker beyond the first 100 comments can cause a duplicate on a retried dispatcher run.
  • Resolve merge risk (P1) - The PR body does not record whether OpenClaw Bay is affected; it should state the expected no-Bay impact or include the corresponding Bay update and proof.
  • Resolve merge risk (P1) - The claimed production result is not backed by a redacted after-fix dispatcher run and GitHub comment trace.
  • Complete next step (P2) - The marker-validation and pagination repairs are narrow and mechanical, although the contributor must still supply real dispatcher proof.

Findings

  • [P2] Validate acknowledgement markers against the ClawSweeper App — .github/workflows/clawsweeper-dispatch.yml:116-120
  • [P2] Paginate the acknowledgement-marker lookup — .github/workflows/clawsweeper-dispatch.yml:114-115
  • [low] Untrusted comments can suppress the App acknowledgement — .github/workflows/clawsweeper-dispatch.yml:119
Agent review details

Security

Needs attention: The new workflow makes an acknowledgement decision from untrusted public comment content.

Review metrics

Metric Value Why it matters
Changed surface 1 workflow changed, 1 matching template changed, 1 test file added The live target-dispatcher workflow and its documented copy must remain behaviorally identical.
Line delta workflow +64, docs +64, tests +96 The new workflow behavior is narrowly scoped but its static tests do not exercise a real GitHub comment path.

Merge-risk options

Maintainer options:

  1. Authenticate and paginate receipt markers (recommended)
    Require the existing marker to be authored by the ClawSweeper App, scan sufficient comment pages, and cover spoofed and second-page markers before merging.
  2. Pause the dispatcher fallback
    Hold this workflow change if the acknowledgement path cannot preserve its public receipt guarantee against untrusted comments and retry conditions.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Require the marker scan to accept only the ClawSweeper App sender, paginate enough to preserve duplicate-run idempotence, and add coverage for spoofed and second-page markers.

Technical review

Best possible solution:

Match the Worker’s authenticated, paginated acknowledgement lookup in both dispatcher copies, add focused spoofing and multi-page coverage, then attach a redacted controlled target-repository run proving one receipt comment and the stated Bay impact.

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

Yes, for the review defects: a contributor can add the public marker to their PR before dispatch, and source inspection shows the workflow will skip the acknowledgement; a draft with more than 100 prior comments can similarly hide a page-two marker.

Is this the best way to solve the issue?

No. The dispatcher should reuse the current Worker’s authenticated, paginated marker semantics instead of relying on an unverified first-page text search.

Full review comments:

  • [P2] Validate acknowledgement markers against the ClawSweeper App — .github/workflows/clawsweeper-dispatch.yml:116-120
    This check accepts any PR comment with the public marker text. A contributor can post &lt;!-- clawsweeper-pr-ack:opened item=&lt;number> --> before the workflow runs, causing the dispatcher to skip the receipt message. Current main's Worker lookup filters matching markers to the ClawSweeper App sender; apply the same boundary here.
    Confidence: 0.99
  • [P2] Paginate the acknowledgement-marker lookup — .github/workflows/clawsweeper-dispatch.yml:114-115
    The lookup fetches only the first 100 comments. If a draft accumulates more than 100 comments before ready_for_review, its acknowledgement can be on page two; a workflow retry then cannot see it and posts a duplicate despite the idempotence claim. Current main scans multiple pages for this marker.
    Confidence: 0.96

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 06bc47a5bde8.

Labels

Label changes:

  • add P2: The receipt acknowledgement can be suppressed or duplicated in normal contributor-facing dispatcher flows, while review dispatch itself continues.
  • add merge-risk: 🚨 security-boundary: An untrusted PR commenter can satisfy the public marker test and control whether the App posts its acknowledgement.
  • add merge-risk: 🚨 automation: The PR changes target-repository workflow automation and its idempotence behavior under retries and copied templates.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab 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 tests and production observations but provides no inspectable after-fix dispatcher run, receipt comment, or redacted trace; add one after the code fixes and request a fresh review. 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: The receipt acknowledgement can be suppressed or duplicated in normal contributor-facing dispatcher flows, while review dispatch itself continues.
  • merge-risk: 🚨 security-boundary: An untrusted PR commenter can satisfy the public marker test and control whether the App posts its acknowledgement.
  • merge-risk: 🚨 automation: The PR changes target-repository workflow automation and its idempotence behavior under retries and copied templates.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab 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 tests and production observations but provides no inspectable after-fix dispatcher run, receipt comment, or redacted trace; add one after the code fixes and request a fresh review. 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

Security concerns:

  • [low] Untrusted comments can suppress the App acknowledgement — .github/workflows/clawsweeper-dispatch.yml:119
    The marker scan does not verify the author, unlike the current Worker implementation, so any PR participant can create the marker that prevents the App from posting its receipt.
    Confidence: 0.99

Acceptance criteria:

  • [P1] pnpm test:unit.
  • [P1] pnpm run check.
  • [P1] Run a controlled target-repository dispatcher event and retain a redacted workflow/comment trace showing one acknowledgement.

What I checked:

  • PR marker lookup trusts unverified comments: The new dispatcher treats any comment containing the public marker prefix and item suffix as an existing acknowledgement, without checking the comment author; a PR author can post that marker and suppress the intended receipt comment. (.github/workflows/clawsweeper-dispatch.yml:116, 6fbe38d76d2c)
  • Current Worker establishes the safe lookup pattern: Current main accepts acknowledgement markers only from the ClawSweeper GitHub App and scans up to five pages; the PR's new workflow omits both protections. (dashboard/worker.ts:2636, 06bc47a5bde8)
  • Current receipt behavior provenance: The current Worker receipt acknowledgement was introduced by the merged receipt-at-event change, so this PR is a fallback for missing target-webhook delivery rather than an already-implemented dispatcher change. (dashboard/worker.ts:2675, 06bc47a5bde8)
  • Proof remains non-inspectable: The PR body reports tests and production observations, but it contains no after-fix target-dispatcher run, receipt-comment trace, or linked redacted artifact. (6fbe38d76d2c)

Likely related people:

  • steipete: Introduced the current-main Worker receipt acknowledgement through the merged change that this dispatcher fallback mirrors. (role: receipt acknowledgement feature owner; confidence: high; commits: 06bc47a5bde8; files: dashboard/worker.ts, test/dashboard-worker.test.ts)
  • Martin Cleary: Introduced the current target dispatcher workflow and its documentation template, which this PR extends. (role: target-dispatcher template introducer; confidence: medium; commits: d26f5cef430f; files: .github/workflows/clawsweeper-dispatch.yml, docs/target-dispatcher.md)

Rank-up moves

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

  • Filter marker comments to the ClawSweeper App and paginate the lookup with focused regression coverage.
  • Attach a redacted target-dispatcher run showing exactly one receipt comment and state whether OpenClaw Bay is unaffected.
  • After updating the body with proof, obtain a fresh ClawSweeper review.

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 6971afb into main Aug 9, 2026
19 checks passed
@steipete
steipete deleted the steipete/dispatcher-pr-ack branch August 9, 2026 05:31
steipete added a commit to openclaw/openclaw that referenced this pull request Aug 9, 2026
Propagate the receipt-acknowledgment steps from the canonical
ClawSweeper dispatch template (openclaw/clawsweeper#1080): mint a
minimal issues:write App token and post an idempotent
clawsweeper-pr-ack marker comment for non-draft opened and
ready_for_review pull requests, before review dispatch.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 10, 2026
…aw#120934)

Propagate the receipt-acknowledgment steps from the canonical
ClawSweeper dispatch template (openclaw/clawsweeper#1080): mint a
minimal issues:write App token and post an idempotent
clawsweeper-pr-ack marker comment for non-draft opened and
ready_for_review pull requests, before review dispatch.
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. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. 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