-
-
Notifications
You must be signed in to change notification settings - Fork 79.2k
Feishu replies disappear from webchat after compaction rotation (buildSuccessorEntries drops assistant messages) #76729
Copy link
Copy link
Open
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.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: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.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: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Description
After compaction with
truncateAfterCompaction: true, assistant messages are dropped from the rotated session transcript. This causes:appendSessionTranscriptMessagebefore compaction)rotateTranscriptFileAfterCompaction,buildSuccessorEntriesmarks all messages beforefirstKeptEntryIdas"removedIds"— including assistant replies[user_msg_1],[compaction summary],[user_msg_2]— with NO assistant reply between themReproduction Steps
maxActiveTranscriptBytes)shouldRotateCompactionTranscriptreturnstrue→rotateTranscriptFileAfterCompactioncreates new session fileRoot Cause
In
compaction-successor-transcript-ZByj7D6a.js, functionbuildSuccessorEntries:All messages before
firstKeptEntryIdare removed, regardless of role (user or assistant). User messages tend to survive because they are referenced byfirstKeptEntryId, but the assistant replies to those user messages are dropped.Session stats from the bug reproduction:
Impact
Suggested Fix
In
buildSuccessorEntries, when determining which messages to remove, preserve the last assistant reply that precedes each surviving user message. This ensures that the rotated transcript maintains conversational structure (user → assistant → user → assistant) rather than collapsing into consecutive user messages.Alternatively, ensure that compaction rotation preserves all assistant messages that are direct replies to surviving user messages.
Environment