fix(session-memory): skip delivery-mirror entries and dedup consecutive identical assistant messages (#92563)#93267
Conversation
…ve identical assistant messages (openclaw#92563) - Skip assistant messages with provider=openclaw and model=delivery-mirror in getRecentSessionContent, since they duplicate the visible text of the preceding assistant message and belong to delivery bookkeeping. - Dedupe consecutive assistant messages with identical visible text as a safety net for any other path that produces redundant rows. Co-Authored-By: Claude <[email protected]>
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. This PR contains useful session-memory bugfix work, but it is no longer the best landing path because a newer clean, proof-positive PR owns the same linked bug with the narrower existing transcript-only assistant filter. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Close this branch and continue review on #94401 as the canonical helper-based session-memory fix for the linked bug. So I’m closing this here and keeping the remaining discussion on #94401. Review detailsBest possible solution: Close this branch and continue review on #94401 as the canonical helper-based session-memory fix for the linked bug. Do we have a high-confidence way to reproduce the issue? Yes at source level. Current main appends every extracted user/assistant text row, so a raw assistant entry plus a transcript-only delivery-mirror or gateway-injected copy can produce duplicate assistant lines in session-memory output. Is this the best way to solve the issue? No. The broad text-dedup approach is a plausible mitigation, but the existing transcript-only assistant helper is the narrower maintainable fix and is already used by the clean canonical PR. Security review: Security review cleared: The diff only changes session-memory transcript filtering and colocated tests; it does not touch dependencies, CI, scripts, secrets, permissions, or code-execution surfaces. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 23b8f5d03782. |
…livery-mirror skip (openclaw#92563) - Replace unconditional delivery-mirror skip with consecutive identical-text dedup that preserves standalone delivery-mirror replies while still handling the raw/cleaned thinking duplicate case. - Standalone delivery-mirror rows that differ from the preceding assistant text are now preserved, matching the chat history contract. Co-Authored-By: Claude <[email protected]>
…ross-turn replies (openclaw#92563) - Reset lastAssistantText when a visible user message is included in the memory summary, so an assistant reply from a different turn that happens to repeat the same text is preserved. - Only dedupe consecutive assistant rows within the same turn. Co-Authored-By: Claude <[email protected]>
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
ClawSweeper applied the proposed close for this PR.
|
Summary
getRecentSessionContent未对 consecutive assistant 消息做去重,导致thinking 模型的 raw(thinking+text) 和 cleaned(text-only) 消息在 session
memory 中产生重复行。
修复: 连续相同文本的 assistant 消息仅保留第一条,遇到 user 消息重置状态。
Fixes #92563
Verification
vitest: 28/28 通过
修复前 vs 修复后对比
🤖 Generated with Claude Code