fix(workflow): make direct PR webhook intake canonical#703
Conversation
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Closing after maintainer deep review. The duplicate-ingress evidence is credible, but this guard removes a documented reliability boundary rather than deduplicating it.
The safe shape is semantic cross-route dedupe at the durable queue boundary: coalesce a matching direct and legacy delivery, while still admitting a legacy-only delivery and preserving later Author context was positive: @brokemac79 is a write collaborator/read-only maintainer with a substantial history of merged ClawSweeper queue fixes. This close is about the fallback ownership boundary, not contributor quality. |
Summary
pull_requestwebhook the canonical exact-review ingress for PR events.pull_request_targetrepository-dispatch compatibility path from creating a second durable review intent, runner, and queue handoff.synchronizeandedited) and maintainerissue_commentcommands eligible.Problem and evidence
One OpenClaw PR push entered the durable exact-review control plane twice:
openclaw/openclaw#110767received heada1e94e165a58a0ac86ec30744ddca8499937e3d3at 10:19 UTC.sourceEvent=pull_request,sourceAction=synchronize, performed the real review, and queued publication.pull_request_targetand durably enqueued the same intent again.This is ingress duplication, not a head-SHA dedupe problem: later body edits, revisions, and maintainer commands can be meaningful and must continue to enqueue.
Implementation
The legacy queue-intake job now skips only a repository-dispatch payload whose pair is:
The guard is at the job condition, before runner allocation and before the durable enqueue request. It does not suppress direct
pull_requestwebhook deliveries,issues, orissue_commentcommand flows.The regression coverage:
pull_request_targetPR route is excluded;synchronizefollowed byedited, and verifies the queue records revision 2 with the later body-update decision;issue_commentmaintainer review commands.Relationship to #674 and terminal behavior
Draft #674 owns the per-item generation, live terminal-target checks, and terminal reconciliation work. It does not address duplicate direct-plus-legacy ingress. This PR deliberately avoids duplicating or conflicting with #674; prompt terminalization/supersession of closed or merged targets remains its dependency and should land through #674.
Validation
actionlintis unavailable on this host. The workflow change is a GitHub-expression-only job guard; the existing legacy intake script was extracted from YAML and passedbash -n.Codex review closeout:
Both completed with no accepted or actionable findings. The second review ran after rebasing onto current
origin/main(639d459f22).Risk and rollout
The direct GitHub App webhook is already the source that completed the observed PR review. After deployment, only the redundant legacy
pull_request_targetcompatibility delivery is skipped; a new direct webhook delivery remains a separate durable intent. No gate, dispatch, review, label, or merge behavior changes.This touches
.github/workflows/sweep.yml, so GitHub OAuth/workflow-scope policy may require a maintainer-owned replacement branch in environments that reject workflow-file updates. No new permissions or token scopes are requested.