Repository navigation
Description
Version: 2026.8.1-beta.1 (ff8a3fe)
Runtime: claude-cli backend, anthropic/claude-opus-5
Surfaces affected: Control UI (webchat) and the Android app. Telegram is not affected.
Summary
With the claude-cli backend, every assistant turn is persisted twice through two independent writers, and clients that render the transcript show both. The user sees the full turn, then immediately a second copy of the same turn as one plain block.
The two copies are not byte-identical, so the Control UI's "consecutive duplicate text-only messages collapse into one bubble with a count badge" rule (documented in web/control-ui.md) never fires.
Expected vs actual
Expected: one assistant turn appears once.
Actual: the turn appears twice:
- Live/canonical view — each assistant text block as its own bubble, interleaved with tool-call cards, imported from the Claude Code transcript (
importedFrom: "claude-cli",api: "anthropic-messages",stopReason: "end_turn"). - Aggregate record — a single message whose
contentholds one text block with every intermediate narration line and the final answer concatenated (api: "cli",stopReason: "stop",idempotencyKey: "cli-assistant:<runId>"), written ~650 ms later.
The more intermediate text a turn emits, the larger the visible duplicate.
Evidence
Session store: ~/.openclaw/agents/<agentId>/agent/openclaw-agent.sqlite, table transcript_events.
select seq, event_json, created_at
from transcript_events
where session_id like '<session>%'
order by seq;A turn that emitted two narration lines plus a final answer produced this aggregate:
seq 44 api=cli len=1835 text blocks in content: 1
"Son 18 (16 "New chat", una sin etiqueta y la del móvil). Voy con la del móvil primero…
\n\nLa herramienta está limitada a mi propio árbol de sesiones. Voy por la CLI.
\n\nHecho. Las 18 archivadas, verificado contra la base de datos. …"
That single record reproduces, verbatim and in order, the three separate bubbles the client had already rendered for the same turn.
Across the whole store: 84 duplicated turns out of 307 assistant messages carrying text. The pattern is constant — a cli record paired with a twin whose api differs (anthropic-messages, openclaw-transcript or openai-responses) and whose byte length is identical.
Where it comes from
persistCliAssistantTranscript() in dist/cli-runner-*.js writes the aggregate via appendExactAssistantMessageToSessionTranscript with idempotencyKey: cli-assistant:${runParams.runId}.
It is gated by runParams.persistAssistantTranscript, computed in dist/agent-runner.runtime-*.js as:
persistAssistantTranscript:
turn.followupRun.currentInboundEventKind !== "room_event" &&
turn.followupRun.run.suppressTranscriptOnlyAssistantPersistence !== trueand suppressTranscriptOnlyAssistantPersistence is only set for room events (get-reply-*.js: suppressTranscriptOnlyAssistantPersistence: isRoomEvent). So for ordinary DM turns the aggregate is always written, in addition to the per-block import from the CLI transcript. There is no user-facing setting to disable it.
Possibly related condition
openclaw doctor reports on the same install:
- Main session transcript missing (~/.openclaw/agents/<agentId>/sessions/<sessionId>.jsonl).
That directory holds 138 *.trajectory-path.json pointers and zero .jsonl transcripts. With no native transcript to reconcile against, the two writers never converge.
Why Telegram is unaffected
Channel delivery sends the final text once — the gateway log shows a single outbound send ok per message. Telegram renders what was delivered, not the transcript, so the aggregate is never shown there.
Related
PR #98117 (fix(ios): avoid transient duplicate final replies) addresses a neighbouring symptom in the shared chat view model, where a live chat.final row is adopted by the canonical session.message instead of being appended twice. This report is one layer lower: two rows are genuinely persisted, so adopting at render time would hide the duplicate rather than prevent it.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Aug 14, 2026
ClawSweeper status: review started.
Codex review: this still needs some work.
Summary
Keep this issue open: text-only duplication is partly fixed, but image-reply duplication and historical attachment aggregates remain outside a complete repair.
Reproducibility: Current source and the existing coverage matrix establish that an attachment-owning historical aggregate remains alongside imported segments covering its text; reported image-caption failures also match the unnormalized suffix comparison, but no live run was performed.
Root-cause cluster
Relationship:
canonicalCanonical: #123792
Summary: This issue retains the broader aggregate-versus-native history problem, including historical attachment cases beyond the focused image-caption follow-up.
Members:
partial_overlap: fix(claude-cli): show each answer once in Claude CLI chat history #184098 - Merged repair addresses new completed text turns and is included in v2026.11.5 onward.partial_overlap: fix(gateway): drop covered cli-assistant history aggregates #137788 - Merged read-time repair drops fully covered historical text aggregates but explicitly retains attachment-owning aggregates.partial_overlap: fix(gateway): stop Claude CLI image replies from repeating narration #188333 - Merged repair handles a native-media caption suffix case without closing historical cases.partial_overlap: [Bug]: Control UI still repeats claude-cli narration at the top of MEDIA image replies on main (after #188333) #195857 - Open focused report covers image-reply narration duplication after the merged fixes.fixed_by_candidate: fix(gateway): show claude-cli narration only once in replies that send images #195959 - Open repair targets delivered MEDIA directives and usage footers, leaving historical attachment reconciliation outside its stated scope.Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Next step
Review #195959 and establish a failing historical attachment regression before considering this broader issue resolved.
Review details
Best possible solution:
Show native narration and final replies once while preserving canonical attachments and original transcript bytes.
Do we have a high-confidence way to reproduce the issue?
Current source and the existing coverage matrix establish that an attachment-owning historical aggregate remains alongside imported segments covering its text; reported image-caption failures also match the unnormalized suffix comparison, but no live run was performed.
Is this the best way to solve the issue?
The existing producer and display owners are the right repair boundaries; evaluate the focused image-caption PR and establish a separate historical attachment regression before changing coverage, preserving uncertain imports and attachment visibility.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning medium; reviewed against 70f100d4ff01.
Label changes
Label changes:
clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.clawsweeper:needs-maintainer-review: Current issue advisory state selects this label.Label justifications:
P2: Repeated history text impairs conversation readability while generation and replies remain usable.impact:session-state: The history projection retains overlapping native segments and canonical aggregate representations of assistant turns.impact:ux-friction: Users see repeated narration or answers when reading web and mobile conversations.Evidence reviewed
Acceptance criteria:
What I checked:
src/agents/cli-runner.ts:585, 70f100d4ff01)src/gateway/cli-session-history-index.worker.ts:216, 70f100d4ff01)src/gateway/cli-session-history.test.ts:655, 70f100d4ff01)src/gateway/cli-session-history.merge-aggregates.ts:79, cd3e054c9a46)src/gateway/server-methods/chat-transcript-persistence.ts:178, 70f100d4ff01)Likely related people:
src/gateway/cli-session-history.merge-aggregates.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.Reviewed November 19, 2026, 2:26 PM ET / 19:26 UTC.
clawsweeper commentedon Aug 14, 2026
🦞🔧
ClawSweeper is automatically building this issue.
The issue review finished and no active implementation pull request was found.
Automatic implementation progress:
clawsweeper:manual-onlyorclawsweeper:human-review.63 remaining items
samiralibabic commentedon Nov 10, 2026
Release status of the three fixes, checked today against the tags and the release branch with GitHub's compare API:
release/2026.11.5(1d58dfd)MEDIA:attachment)This may matter more for 2026.11.5 than for earlier releases. On
release/2026.11.5,isCollapsibleWorkGroupno longer folds assistant groups with visible text (via #183267). On 2026.10.7 the imported per-segment copies of a turn mostly sit inside the collapsed "Worked" group, so the second copy only shows when it is expanded. Without #137788 and #188333, I would expect older Claude CLI turns, and turns whose reply ends with aMEDIA:attachment, to show both copies in full on 2026.11.5. I haven't run the candidate; this is from reading the branch.Could #137788 and #188333 be considered for 2026.11.5?
openclaw-barnacle commentedon Nov 18, 2026
This issue has been automatically marked as stale after 7 days without qualifying human activity.
Without new human activity, Barnacle may close it as not planned 7 days after this message was posted. This is administrative inactivity cleanup, not a claim that the problem is fixed.
A human update restarts the inactivity clock; a new PR head also restarts it. A maintainer can add no-stale for a durable hold, or bad-barnacle to suppress Barnacle. Remove the hold when work can resume.
laurencebrown commentedon Nov 18, 2026
Both fix PRs are merged (#184098 on Oct 27, #137788 on Oct 31) but neither is in any release yet, v2026.11.4 included — verified via the compare API against the release tags. Keeping this open until a release actually contains the fix seems right; closing as stale would be misleading while users on every current release still see the bug.
openclaw-barnacle commentedon Nov 25, 2026
This issue has been automatically marked as stale after 7 days without qualifying human activity.
Without new human activity, Barnacle may close it as not planned 7 days after this message was posted. This is administrative inactivity cleanup, not a claim that the problem is fixed.
A human update restarts the inactivity clock; a new PR head also restarts it. A maintainer can add no-stale for a durable hold, or bad-barnacle to suppress Barnacle. Remove the hold when work can resume.
samiralibabic commentedon Nov 25, 2026
ping