clawsweeper icon indicating copy to clipboard operation
clawsweeper copied to clipboard

Duplicate command ack comments are posted for a single @clawsweeper issue command

Open brokemac79 opened this issue 6 months ago • 3 comments

Summary

ClawSweeper posted duplicate command acknowledgement comments for the same issue command on openclaw/openclaw#88102.

Evidence

On openclaw/openclaw#88102, the issue author posted:

@clawsweeper re-review based on latest comments

User command comment:

https://github.com/openclaw/openclaw/issues/88102#issuecomment-4579020705

ClawSweeper then posted two separate acknowledgement comments with the same marker:

https://github.com/openclaw/openclaw/issues/88102#issuecomment-4579021116
https://github.com/openclaw/openclaw/issues/88102#issuecomment-4579022447

Both bodies started with the same durable marker:

<!-- clawsweeper-command-ack:4579020705 -->

The same duplicate behavior happened again for a later author command:

@clawsweeper review based on full details of the ticket plus additional comments

User command comment:

https://github.com/openclaw/openclaw/issues/88102#issuecomment-4579054352

Duplicate ClawSweeper ack comments:

https://github.com/openclaw/openclaw/issues/88102#issuecomment-4579054896
https://github.com/openclaw/openclaw/issues/88102#issuecomment-4579056165

Both used the same marker:

<!-- clawsweeper-command-ack:4579054352 -->

A screenshot from the issue view also showed two identical ClawSweeper picked this up. Command router queued. I will update this comment with the next step. comments under a single user command.

Expected behavior

For one command comment, ClawSweeper should create or update one acknowledgement comment keyed by clawsweeper-command-ack:<source-comment-id>.

If duplicate webhook deliveries, retries, or concurrent routers process the same command, the ack writer should be idempotent and update/reuse the existing ack comment instead of posting a second one.

Actual behavior

Two acknowledgement comments were created for the same source command comment id.

Impact

This creates duplicate noise on user-facing OpenClaw issues and makes it harder to tell whether one or two command-router jobs are active.

Notes

This was observed on openclaw/openclaw#88102 on May 29, 2026. The old issue was later superseded by openclaw/openclaw#88120 for unrelated report-cleanup reasons, but the duplicate ack evidence remains in #88102 comments.

brokemac79 avatar May 29 '26 19:05 brokemac79

Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed May 29, 2026, 4:06 PM ET / 20:06 UTC.

Summary Keep open: the live linked OpenClaw issue still has duplicate marker-backed ack comments for two separate command comments after the current coalescing fix was deployed, so this is not safely implemented on main.

Reproducibility: yes. The public linked comments still show two ack comments with the same source-comment marker for each of two commands, and the relevant dashboard/webhook code has not changed since the deployed c01469876 fix.

Next step Queue a narrow fix because the live duplicate evidence is clear and the likely webhook/router cleanup files are bounded.

Review details

Best possible solution:

Make ack convergence deterministic across duplicate webhook deliveries, delayed redeliveries, and Worker instances, with router-side or longer-window cleanup so extra marker-backed acks are removed even if the fast webhook cleanup misses them.

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

Yes. The public linked comments still show two ack comments with the same source-comment marker for each of two commands, and the relevant dashboard/webhook code has not changed since the deployed c01469876 fix.

Is this the best way to solve the issue?

No for the current partial mitigation. The in-memory coalescing and short delayed prune passes are useful, but the live duplicate evidence shows ClawSweeper needs a more deterministic cleanup/idempotency path.

AGENTS.md: found and applied where relevant.

Remaining risk / open question:

  • The remaining root cause may be delayed duplicate delivery, Worker isolate state, GitHub comment-list consistency, or deployment/version skew, but the visible duplicate comments prove the current convergence path is not reliable enough.

Codex review notes: model gpt-5.5, reasoning high; reviewed against f37d8cdc6cf0.

Label changes

Label changes:

  • add P2: This is a real user-facing automation bug, but its direct impact is duplicate command noise rather than data loss or a fully broken workflow.
  • add impact:message-loss: The issue is about duplicated public bot messages for a single source command.
  • add issue-rating: 🦀 challenger crab: Current issue advisory state selects this label.
  • add clawsweeper:current-main-repro: Current issue advisory state selects this label.
  • add clawsweeper:queueable-fix: Current issue advisory state selects this label.
  • add clawsweeper:fix-shape-clear: Current issue advisory state selects this label.

Label justifications:

  • P2: This is a real user-facing automation bug, but its direct impact is duplicate command noise rather than data loss or a fully broken workflow.
  • impact:message-loss: The issue is about duplicated public bot messages for a single source command.
Evidence reviewed

Acceptance criteria:

  • pnpm run test:repair
  • pnpm run test:unit
  • pnpm run check

What I checked:

  • Live duplicate ack evidence: The public GitHub API still shows two clawsweeper[bot] comments with marker clawsweeper-command-ack:4579020705 and two more with marker clawsweeper-command-ack:4579054352 on https://github.com/openclaw/openclaw/issues/88102.
  • Current webhook cleanup is best-effort: Current main coalesces only in-process duplicate acks with an in-memory map and then schedules two short delayed prune passes after dispatch. (dashboard/worker.ts:46, f37d8cdc6cf0)
  • No router-side duplicate ack cleanup: The comment router only uses status_comment_id to find and patch one precreated ack; searches found no router-side pruning for extra clawsweeper-command-ack comments. (src/repair/comment-router.ts:3003, f37d8cdc6cf0)
  • Partial fix provenance: Commit c01469876a8575896e3d81bc94daafdfaea1efca introduced the current coalescing and cleanup tests in https://github.com/openclaw/clawsweeper/pull/221. (dashboard/worker.ts:46, c01469876a85)
  • Incident occurred after dashboard deploy: The ClawSweeper Live Dashboard deployment for c01469876 completed successfully on 2026-05-28T15:42:44Z, before the duplicate acks observed on 2026-05-29T19:19Z and 19:23Z; no relevant dashboard/webhook files changed between c01469876 and current main. (c01469876a85)

Likely related people:

  • Tak Hoffman: Authored the current duplicate-ack coalescing fix and tests in commit c01469876. (role: recent area contributor; confidence: high; commits: c01469876a85; files: dashboard/worker.ts, src/repair/comment-webhook.ts, test/dashboard-worker.test.ts)
  • Peter Steinberger: Introduced the earlier prune-based ack cleanup path and the initial webhook/dashboard implementation history around this surface. (role: original webhook and prune-path contributor; confidence: medium; commits: 8482e5071867, c6d8067054ec; files: dashboard/worker.ts, src/repair/comment-webhook.ts)
How this review workflow works
  • 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.

clawsweeper[bot] avatar May 29 '26 19:05 clawsweeper[bot]

@clawsweeper review

brokemac79 avatar May 29 '26 19:05 brokemac79

🦞🧹 ClawSweeper re-review requested.

I asked ClawSweeper to review this item again. Action: item re-review queued (workflow sweep.yml, event repository_dispatch). Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

  • State: Complete
  • Detail: The targeted re-review finished, the durable review comment was updated, and the synced verdict was routed.
  • Run: https://github.com/openclaw/clawsweeper/actions/runs/26659220817
  • Updated: 2026-05-29T20:06:38.469Z

clawsweeper[bot] avatar May 29 '26 19:05 clawsweeper[bot]