-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Bug]: TUI displays assistant reply twice when triggered via Telegram channel #96967
Copy link
Copy link
Closed
Closed
Copy link
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.bugSomething isn't workingSomething isn't workingbug:behaviorIncorrect behavior without a crashIncorrect behavior without a crashclawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.bugSomething isn't workingSomething isn't workingbug:behaviorIncorrect behavior without a crashIncorrect behavior without a crashclawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Type
Fields
Priority
None yet
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
Root cause: In tui-D1r4yDv-.js (dist/), handleSessionsChangedEvent (line ~3073) triggers a full loadHistory() when receiving a sessions.changed event with reason: "new". This happens AFTER the assistant message has already been finalized via chatLog.finalizeAssistant(finalText, evt.runId) (line ~3046).
loadHistory() then walks the session record and calls chatLog.finalizeAssistant(text) (line ~3663, no runId passed) for every assistant message in history — including the one already displayed. Because no runId is tracked for history replay, the dedup mechanism in finalizedRuns set doesn't apply, and the message is appended as a new component.
Expected: TUI should not re-render the just-finalized message.
Suggested fix:
Affects: openclaw-tui, version 2026.6.10 Config: channels.telegram.enabled: true + openclaw-tui running on the same gateway
Steps to reproduce
Repro:
Expected behavior
Actual behavior
Repro:
OpenClaw version
2026.6.10
Operating system
macOS 26.5.1
Install method
npm
Model
minimax-m3
Provider / routing chain
openclaw -> ollama -> minimax-m3:cloud
Additional provider/model setup details
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
No response