Repository navigation
fix(bay): correlate direct re-review completions - #1172
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 8:07 AM ET / 12:07 UTC. ClawSweeper reviewWhat this changesThis PR preserves the original GitHub webhook delivery ID alongside the durable re-review command identity so OpenClaw Bay can join direct re-review triggers with their completions. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep this PR open: its central repair is not on current main, the current-head diff has no actionable correctness finding, and the supplied real Worker/Durable Object proof supports review for landing. Priority: P2 Review scores
Verification
How this fits togetherHosted re-review webhooks enter the Worker and Durable Object queue, which later records lifecycle completion. OpenClaw Bay consumes those events to build completed-journey timing summaries. flowchart LR
A[GitHub re-review webhook] --> B[Worker command intake]
B --> C[Durable command receipt]
C --> D[Lifecycle acknowledgement]
D --> E[Bay telemetry]
E --> F[Completed journey summary]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the additive identity mapping, retain the command-version fence for queue authority, and observe the first hosted direct re-review after deployment for one joined Bay journey. Do we have a high-confidence way to reproduce the issue? Yes—current-main source routes direct re-review completion through the command-version identity, while the candidate retains the webhook identity separately; I did not execute a failing current-main runtime reproduction. Is this the best way to solve the issue? Yes—the additive Bay-only identity preserves the existing command-version fence and legacy fallback instead of changing command authority or rewriting historical state. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9fb6d6bfe562. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
c0339b5 to
c272176
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(bay): correlate direct re-review completions This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
Summary
Restores OpenClaw Bay completed-journey correlation for hosted direct
@clawsweeper re-reviewcommands without undoing PR #1143's command-version fencing.Problem
PR #1143 deliberately changed direct re-review
sourceDeliveryIdfrom the GitHub webhook delivery (G) to a deterministic command-version identity (C). Bay records the trigger underG, but lifecycle acknowledgement emitted the completion underC; Bay therefore created separate partial records and the tide summary had zero completed samples.Implementation
bayJourneyDeliveryIdalongside feat(review): make re-review command intake durable #1143's command-versionsourceDeliveryId.Gif the first Bay write was unavailable.This is additive durable state. Existing projections without the field remain valid and use legacy behaviour; no migration or cache invalidation is required. Historical partial journeys cannot be deterministically repaired by this code alone, but new completions after deployment join their live triggers.
Validation
pnpm run build:allpnpm run lint:dashboardnode --test --test-concurrency=1 test/dashboard-worker-command-intake.test.ts test/dashboard-worker-bay-records-routes.test.ts— 46 passed, 0 failed.git diff --checkorigin/main(9fb6d6bfe562611ba5c40e60521ba4a726bac926): clean, no actionable findings.decision=keep_open,action=kept_open).c272176e9bdc85ff1d36648c218c31c6afd54773: no actionable findings;proof: sufficientandstatus: 👀 ready for maintainer lookapplied.pnpm check, both CodeQL analyses, and the hermetic automerge-flow test: successful.pnpm run checkis blocked by the existing repository formatting baseline:oxfmt --checkreports 719 unrelated files. The touched files were formatted and the focused build/tests pass.Real Behavior Proof
Claim: A signed hosted direct re-review retains its raw GitHub delivery identity through durable intake and lifecycle acknowledgement, allowing Bay to produce one completed in-window journey even when only the normal workflow acknowledgement arrives.
Exercised surface: Worker GitHub webhook, direct intake, actual in-memory Durable Object queue admission/alarm, lifecycle projection, signed internal lifecycle acknowledgement endpoint, and Bay journey state.
Scenario: The regression test sends a real HMAC-signed command webhook with delivery
Gwhile Bay storage is unavailable. Its GitHub redelivery is command-deduplicated but returns the durable originalG, allowing Bay telemetry to recover exactly one journey. It then drives the queue alarm, records terminal lifecycle facts, and sends the signed workflow acknowledgement without relying on a terminal GitHub webhook. The endpoint returnsbay_journey_delivery_id=G; Bay contains exactly one joined journey and one timing sample. A subsequent terminal webhook remains idempotent.Command/environment: the focused Node test command above on this checkout at
c272176e9b.Direct-Docker runtime proof: coordinator-authorized fallback after CRA-001 Crabbox transport failure. At exact head
c272176e9bdc85ff1d36648c218c31c6afd54773/ tree94b50bdd94a30c5d88222cc6230c83006ea56259, a clean read-only source mount was copied into disposable containerclawsweeper-proof:node24-jq@sha256:b9ddc0c04722a87ff36948964d93942a316689de01063798032328772a36aeee. The container ran[email protected] dev --localagainst the current Worker with fresh persisted local SQLite Durable Objects. A redacted loopback GitHub server supplied only fixture data; the proof exercised actual HTTP Worker routes and the DO alarm rather than the in-memory test harness. The redelivery was command-deduplicated and explicitly required to return the original Bay delivery identity. Observed result:{"proof":"csw130-direct-docker-wrangler-do","command_status":202,"command_accepted":true,"redelivery_status":202,"redelivery_deduped":true,"github_delivery_id":"csw130-direct-docker-delivery","durable_source_comment_reads":1,"durable_status_comments":1,"lifecycle_acknowledgement_accepted":true,"lifecycle_bay_journey_delivery_id":"csw130-direct-docker-delivery","bay_completed_journey_samples":1,"status_marker_present":true}This proves a real local Worker/DO admission, a deduplicated redelivery retaining
G, and one joined, in-window Bay timing sample on the current head. Docker Engine was 29.5.2. Crabbox itself remains unavailable for this tree because two local-container attempts (cbx_ba0806abf103,cbx_1307edd2fb1b) and configured AWS runrun_2dbd1a63208b/ leasecbx_2794c92c5e43each failed before execution during rsync handshake with code 12; no Crabbox result is claimed.Risks / rollout / rollback
The change only adds optional durable identity and preserves legacy fallback. Roll out normally with the Worker/dashboard deployment, then verify Bay reports a completed sample after the next hosted re-review completes. Existing records are not rewritten; a redelivery can recover a missed trigger during receipt retention. If needed, revert this one commit; no state rollback is needed.
Related: CSW-130; regression introduced by #1143.