Skip to content

fix(queue): complete terminal acknowledgement as durable skip when the status comment is missing - #1004

Merged
steipete merged 1 commit into
mainfrom
fix/missing-comment-terminal-ack
Aug 1, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/missing-comment-terminal-ack

Conversation

@steipete

@steipete steipete commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Problem

Terminal-finalization runs loop forever for items whose command status comment no longer exists (live poison items: openclaw/openclaw#113663, #115277, #116248; sample run 30705586724). The "Update final command status once" step runs repair:update-command-status --require-mutation --locked-conversation-terminal-skip --verify-terminal-status-receipt; with the status comment deleted, the script throws command status mutation required but no comment was found, the fenced acknowledgement never gets a receipt, "Requeue unobserved terminal acknowledgement" requeues the driver, and the item loops every ~20 minutes burning runners and painting runs red. There is nothing left to acknowledge, so the correct terminal state is a completed skip.

Fix

Mirrors the existing locked_conversation terminal-skip pattern end to end:

  • src/repair/update-command-status.ts: in the terminal-acknowledgement context only (--require-mutation + --verify-terminal-status-receipt), a missing status comment becomes outcome missing_status_comment → warn, missing_status_comment=true in GITHUB_OUTPUT, exit 0. Non-terminal callers keep the throw unchanged. The sibling no-address throw is left as is (the workflow's fenced-attempt step already exits nonzero before this point when both marker and comment id are missing).
  • .github/workflows/sweep.yml: the "Complete locked terminal acknowledgement skip" step now also fires on missing_status_comment == 'true', posts /internal/exact-review/terminal-finalization/skip with the matching reason, and asserts the reason-specific acknowledgement_state (skipped_locked vs skipped_missing_comment). The "Requeue unobserved terminal acknowledgement" guard treats a completed missing-comment skip as success, so the driver is deleted instead of requeued.
  • dashboard/exact-review-queue.ts + dashboard/exact-review-lifecycle.ts: the skip endpoint accepts reason missing_status_comment (any other reason still 400s) with the same lease/attempt fencing, and the projection store records a distinct acknowledgement state skipped_missing_comment (lifecycle state stays acknowledgement_skipped). Bay/worker snapshot validators accept the new state.

Proof

  • New unit test drives the built dist/repair/update-command-status.js against a fake gh returning an empty comment list: red against the origin/main build (exits 1 with the exact production error), green after the fix (exit 0 + missing_status_comment=true). A sibling test proves the non-terminal --require-mutation throw is unchanged.
  • New DO test completes a missing-comment terminal acknowledgement via /attempt + /skip (acknowledgement_state: "skipped_missing_comment", driver removed, later ack attempts denied) and asserts an unknown reason still returns 400.
  • Extended sweep-workflow shape assertions cover the new step condition, reason selection, jq assertion, and requeue guard.

Deploy note

A Worker redeploy is required — this changes the Durable Object skip endpoint and lifecycle projection (dashboard/). Until the Worker is redeployed, missing-comment skips will fail the jq assertion (the DO rejects the new reason with 400) and items keep requeueing as today; no worse than the status quo.

…e status comment is missing

Terminal-finalization drivers looped forever every ~20 minutes for items
whose command status comment was deleted (or never existed): the required
status mutation threw, no receipt was recorded, and the driver requeued
endlessly. In the terminal-acknowledgement context the missing comment now
becomes a dedicated missing_status_comment outcome; the sweep workflow
posts a terminal-finalization skip with that reason, the Durable Object
accepts it under the same lease/attempt fencing, and the lifecycle
projection records a distinct skipped_missing_comment acknowledgement
state. Non-terminal --require-mutation callers keep the hard failure.

Requires a Worker redeploy (Durable Object skip endpoint and lifecycle
projection change).
@steipete
steipete requested a review from a team as a code owner August 1, 2026 15:37
@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. P1 Urgent regression or broken agent/channel workflow affecting real users now. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 1, 2026, 11:42 AM ET / 15:42 UTC.

ClawSweeper review

What this changes

The branch makes a missing terminal command-status comment complete as a fenced Durable Object skip instead of endlessly requeueing the finalization driver.

Merge readiness

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

This PR remains necessary: current main turns the deleted-comment terminal path into a required-mutation failure, while the finalization workflow only completes a durable skip for locked conversations. The proposed queue and lifecycle path is focused, but it needs real end-to-end proof and should not carry a release-owned CHANGELOG.md entry in a normal PR.

Priority: P1
Reviewed head: a3779f9e76b4cefef3d8b6b9fb55124bf4534715

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation is focused and test-backed, but it remains below merge-ready quality until the workflow-plus-Worker behavior is demonstrated in a real setup.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR body describes focused unit, Durable Object, and workflow-shape tests, but no inspected after-fix live workflow or deployed Worker evidence proves the complete queue-finalization path. Add redacted terminal or runtime output; updating the PR body should trigger 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 🐚 platinum hermit (4/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body describes focused unit, Durable Object, and workflow-shape tests, but no inspected after-fix live workflow or deployed Worker evidence proves the complete queue-finalization path. Add redacted terminal or runtime output; updating the PR body should trigger 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 5 items Current-main missing-comment behavior: Current main records a skipped update but throws command status mutation required but no comment was found whenever required mutation is enabled, so terminal finalization cannot complete the acknowledgement.
Current-main terminal completion guard: The workflow invokes the updater with required mutation and receipt verification, but only routes locked_conversation to the terminal skip endpoint; an absent comment therefore reaches the requeue path.
Existing durable-skip invariant: The current queue endpoint validates an active terminal attempt and then removes the driver only after the lifecycle projection records the terminal skip; the proposed branch extends this established path with a second reason and state.
Findings 1 actionable finding [P3] Keep release notes out of this normal PR
Security None None.

How this fits together

ClawSweeper’s terminal-finalization workflow updates a command-status comment and records the result through the exact-review queue Durable Object. The lifecycle projection then determines whether the queue driver completes, is retried, and how that terminal result appears in operational dashboard data.

flowchart LR
  A[Terminal finalization driver] --> B[Command status update]
  B --> C{Status comment found?}
  C -->|Yes| D[Observe acknowledgement]
  C -->|No| E[Submit fenced durable skip]
  D --> F[Lifecycle projection]
  E --> F
  F --> G[Complete or requeue driver]
  F --> H[Operational dashboard]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body describes focused unit, Durable Object, and workflow-shape tests, but no inspected after-fix live workflow or deployed Worker evidence proves the complete queue-finalization path. Add redacted terminal or runtime output; updating the PR body should trigger 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.
  • Keep release notes out of this normal PR (P3) - CHANGELOG.md is release-owned under the repository policy. Preserve the user-visible release context in the PR body or commit message and let the release process curate this entry separately.
  • Resolve merge risk (P1) - The workflow now expects the Durable Object endpoint and lifecycle validators to recognize missing_status_comment; deploying only one side preserves the current requeue loop or makes the new state assertion fail.
  • Resolve merge risk (P1) - The branch modifies release-owned CHANGELOG.md, which conflicts with the repository’s normal PR landing policy.
  • Complete next step (P2) - The code path is narrowly scoped, but real behavior proof and a coordinated Worker deployment are required before maintainer landing review.

Findings

  • [P3] Keep release notes out of this normal PR — CHANGELOG.md:175
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Cross-surface change 10 files affected; 301 additions, 19 deletions The fix spans the GitHub Actions terminal path, command updater, Durable Object lifecycle state, dashboard validation, and focused tests.

Merge-risk options

Maintainer options:

  1. Prove the coordinated queue path (recommended)
    Before merge, attach redacted after-fix output from a controlled missing-comment terminal finalization that shows the Durable Object returns skipped_missing_comment and the driver is removed.
  2. Hold for coordinated deployment
    Pause this change if the Worker and workflow cannot be rolled out together, because either half alone cannot complete the new durable skip.

Technical review

Best possible solution:

Deploy the workflow, Durable Object, lifecycle projection, and validators together after attaching redacted live proof that a missing comment produces skipped_missing_comment and deletes the finalization driver; leave release-note curation to the release owner rather than this PR.

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

Yes from source: current main’s required-mutation missing-comment branch throws, while the only current durable-skip workflow condition is locked_conversation. The described failure follows directly when a terminal status comment has been deleted.

Is this the best way to solve the issue?

Yes, with the deployment and proof conditions noted: a reasoned, lease-fenced terminal skip preserves strict required-mutation behavior for ordinary callers instead of weakening it globally.

Full review comments:

  • [P3] Keep release notes out of this normal PR — CHANGELOG.md:175
    CHANGELOG.md is release-owned under the repository policy. Preserve the user-visible release context in the PR body or commit message and let the release process curate this entry separately.
    Confidence: 0.99

Overall correctness: patch is correct
Overall confidence: 0.88

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P1: The reported production path repeatedly requeues terminal-finalization work, consumes runners, and leaves real automation runs failing.
  • add merge-risk: 🚨 automation: Merging changes the production finalization workflow and queue-completion semantics, including a required coordinated Worker deployment.
  • 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 describes focused unit, Durable Object, and workflow-shape tests, but no inspected after-fix live workflow or deployed Worker evidence proves the complete queue-finalization path. Add redacted terminal or runtime output; updating the PR body should trigger 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:

  • P1: The reported production path repeatedly requeues terminal-finalization work, consumes runners, and leaves real automation runs failing.
  • merge-risk: 🚨 automation: Merging changes the production finalization workflow and queue-completion semantics, including a required coordinated Worker deployment.
  • 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 describes focused unit, Durable Object, and workflow-shape tests, but no inspected after-fix live workflow or deployed Worker evidence proves the complete queue-finalization path. Add redacted terminal or runtime output; updating the PR body should trigger 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

What I checked:

  • Current-main missing-comment behavior: Current main records a skipped update but throws command status mutation required but no comment was found whenever required mutation is enabled, so terminal finalization cannot complete the acknowledgement. (src/repair/update-command-status.ts:80, e9f97b34fd59)
  • Current-main terminal completion guard: The workflow invokes the updater with required mutation and receipt verification, but only routes locked_conversation to the terminal skip endpoint; an absent comment therefore reaches the requeue path. (.github/workflows/sweep.yml:3205, e9f97b34fd59)
  • Existing durable-skip invariant: The current queue endpoint validates an active terminal attempt and then removes the driver only after the lifecycle projection records the terminal skip; the proposed branch extends this established path with a second reason and state. (dashboard/exact-review-queue.ts:6747, e9f97b34fd59)
  • Repository release-note policy: Repository policy says CHANGELOG.md is release-owned and normal PR work should preserve release context in the PR body and commits instead. (AGENTS.md:33, e9f97b34fd59)
  • Feature-history routing: Recent history shows Peter Steinberger repeatedly maintaining the sweep workflow and command-status path, while Martin Cleary introduced and recently expanded the durable lifecycle projection and dashboard surface. (dashboard/exact-review-lifecycle.ts:562, 83fa433a0537)

Likely related people:

  • steipete: Recent history attributes several sweep and queue-maintenance commits to Peter Steinberger, including the current main tip and nearby workflow repairs. (role: recent automation-path contributor; confidence: high; commits: e9f97b34fd59, 86cc49d4e0ee; files: .github/workflows/sweep.yml, src/repair/update-command-status.ts, dashboard/exact-review-queue.ts)
  • Martin Cleary: History shows Martin Cleary introducing exact-review lifecycle telemetry and the durable lifecycle Bay projection that this branch extends. (role: lifecycle projection contributor; confidence: high; commits: a80c24ebf2f1, 83fa433a0537; files: dashboard/exact-review-lifecycle.ts, dashboard/worker.ts, dashboard/bay-page.ts)

Rank-up moves

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

  • Attach redacted end-to-end output showing a missing status comment receives skipped_missing_comment and removes the driver.
  • Coordinate the Worker redeploy with the workflow rollout.
  • Keep release-note context in the PR body or commit message rather than CHANGELOG.md.

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 f43618f into main Aug 1, 2026
18 checks passed
@steipete
steipete deleted the fix/missing-comment-terminal-ack branch August 1, 2026 15:44
azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 2026
…e status comment is missing (openclaw#1004)

Terminal-finalization drivers looped forever every ~20 minutes for items
whose command status comment was deleted (or never existed): the required
status mutation threw, no receipt was recorded, and the driver requeued
endlessly. In the terminal-acknowledgement context the missing comment now
becomes a dedicated missing_status_comment outcome; the sweep workflow
posts a terminal-finalization skip with that reason, the Durable Object
accepts it under the same lease/attempt fencing, and the lifecycle
projection records a distinct skipped_missing_comment acknowledgement
state. Non-terminal --require-mutation callers keep the hard failure.

Requires a Worker redeploy (Durable Object skip endpoint and lifecycle
projection change).

Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
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. P1 Urgent regression or broken agent/channel workflow affecting real users now. 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