Repository navigation
Description
Bug type
Bug — UI / session delivery (ACP + Control UI webchat)
Summary
When using ACP-backed sessions in the OpenClaw Control UI (webchat), each user prompt produces two identical assistant reply bubbles. The session transcript records two user+assistant turn pairs for a single prompt, while the gateway appears to dispatch the ACP request only once.
Version
- OpenClaw: 2026.7.1 (
2d2ddc4) - @openclaw/acpx: 2026.7.1
Reproduction
- Connect or run an agent session via ACP (example session key below).
- Open the session in Control UI / webchat.
- Send a single user message / prompt.
- Observe the assistant response area and session transcript.
Example session key: agent:cursor:acp:6507cb8e-e1a8-43d2-b339-bb3e266f59e5 (label: content-pipeline)
Expected behavior
One user message → one assistant reply bubble and one user+assistant pair in the transcript.
Actual behavior
One user message → two identical assistant reply bubbles and two user+assistant pairs in the transcript for the same logical turn.
Screenshot
Mirrors / evidence
- Gist (screenshot + context): https://gist.github.com/iamtornado/e66169a25af276d4bf579a273348a0c1
- Image mirror (72h): https://litter.catbox.moe/rlujzz.png
Transcript excerpt (pattern)
For each single prompt, the transcript shows two back-to-back user+assistant pairs with the same assistant content:
- First pair: user + assistant messages recorded without
idempotencyKey(ACP persist path). - Second pair: user + assistant messages recorded with webchat
messageId/ idempotency metadata (webchat delivery mirror).
Net effect: duplicate bubbles in the UI and duplicated history rows for one logical exchange.
Gateway signal
Gateway logs indicate a single acp_dispatch (or equivalent one-shot ACP dispatch) per prompt — i.e. the backend does not appear to run the agent twice; duplication manifests in persistence and/or webchat delivery layering.
Suspected cause
Likely double recording of the same turn:
- ACP session persist writes user + assistant messages to the transcript without webchat idempotency keys.
- Webchat delivery (Control UI) mirrors or re-appends the same turn with
messageId/ idempotency metadata.
Without deduplication between these paths, the UI renders two identical assistant bubbles for one dispatch.
Impact
- Confusing UX in Control UI (appears the model answered twice).
- Inflated transcript length and token/context noise if both copies are retained.
- Harder to debug session state and message ordering for ACP workflows.
- May affect downstream tooling that counts turns or assumes 1:1 user/assistant pairing.
Environment notes
- Observed on OpenClaw 2026.7.1 with
@openclaw/[email protected]. - Repro tied to ACP session keys in Control UI webchat (not necessarily limited to a single agent label).
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority

Activity
clawsweeper commentedon Jul 18, 2026
Thanks for the context here. I did a careful shell check against current
main, and this is already implemented.The original ACP double-persistence defect is fixed and released; later non-ACP rendering reports describe separate behavior.
So I’m closing this as already implemented rather than keeping a duplicate issue open.
Review details
Best possible solution:
Retain the released ACP producer fix and handle historical cleanup or distinct live-rendering failures in their own focused reports.
Do we have a high-confidence way to reproduce the issue?
Current source prevents the reported second ACP transcript append, with matching inspected Gateway regressions and recorded merged-fix live evidence; no tests or live session were run during this read-only review.
Is this the best way to solve the issue?
The merged repair fixes persistence and completion ownership at the producer boundary, preserving distinct repeated turns without relying on global equal-text deduplication.
Security review:
Security review: This report concerns duplicate conversation persistence and display.
AGENTS.md: found and applied where relevant.
What I checked:
src/auto-reply/reply/dispatch-acp.ts:429, ce4b8d65adc7)src/gateway/server-methods/chat-send-agent-dispatch.ts:598, ce4b8d65adc7)src/gateway/server-methods/chat-send-reply-finalization.ts:299, ce4b8d65adc7)src/gateway/server.chat.acp-completion.test.ts:514, ce4b8d65adc7)Codex review notes: model internal, reasoning medium; reviewed against ce4b8d65adc7; fix evidence: release v2026.8.1, commit 1c40abdb63b8.
iamtornado commentedon Jul 18, 2026
Following up on clawsweeper:needs-info with reproduction evidence from production host
openclaw-37230(10.65.37.230), collected without exposing secrets.Expected vs Actual
acp_dispatch, one user+assistant pair in transcript, one assistant bubble in the UI.acp_dispatch(confirmed in logs), but transcript and UI show two user+assistant pairs with identical assistant text per prompt.Environment
2d2ddc4)~/.openclaw/npm/node_modules/@openclaw/acpx)openclaw-37230agent:cursor:acp:6507cb8e-e1a8-43d2-b339-bb3e266f59e532c14196-1d84-42a9-8c61-3ed55c131edcConfig (ACP / acpx only, non-secret)
{ "acp": { "enabled": true, "backend": "acpx", "defaultAgent": "cursor", "allowedAgents": ["cursor"], "maxConcurrentSessions": 4, "dispatch": { "enabled": true } } }Gateway log excerpt (redacted)
journalctl --user -u openclaw-gateway.serviceforsessionKey=agent:cursor:acp:6507cb8e-e1a8-43d2-b339-bb3e266f59e5on 2026-07-18 11:14–11:16 (+08:00):Observation: exactly one inbound webchat message and one
reason=acp_dispatchcompletion per user prompt — no double-dispatch at the gateway queue layer.Transcript signature excerpt
File:
agents/cursor/sessions/32c14196-1d84-42a9-8c61-3ed55c131edc.jsonl(payloads truncated).Turn 1 (webchat
messageId33502f37-0be3-4e7f-9461-cb368c3cbc2e):33502f37-…:user33502f37-…Turn 2 (webchat
messageIdcac99b70-d9eb-47c5-b637-50ae68b31de7):content-pipelinecac99b70-…:usercac99b70-…Note on layering
For each logical prompt:
model: acp-runtime) withoutidempotencyKey.messageId-derived idempotency keys (…:user/ bare messageId) andmodel: gateway-injected.Gateway telemetry shows a single
acp_dispatchper prompt; duplicates appear to be transcript persistence + Control UI delivery mirroring, not two agent runs.Happy to provide additional redacted logs or a longer transcript slice if maintainers need a specific code path traced on current
main.22 remaining items