fix(conversations): Keep repeated user messages in transcript#119041
Merged
obostjancic merged 7 commits intoJul 7, 2026
Merged
Conversation
The transcript view deduplicated user messages purely by content, so when a user genuinely sent the same message twice in separate turns, the second occurrence was dropped and its assistant reply appeared to have no prompt. Track the number of user messages in each generation's cumulative input history. A tool-loop follow-up reuses the same last user message and keeps a stable count, while a genuine repeat grows the count. Emit a user message when the count grows, in addition to the existing content-based dedup, so tool loops still collapse but real repeats are preserved. Refs TET-2602 Co-Authored-By: Claude <noreply@anthropic.com>
The transcript deduplicated user messages purely by content, so when a user sent the same message twice in separate turns the second occurrence — and its assistant reply — were dropped. Deduplication only makes sense for cumulative SDKs, where a single turn's tool loop replays the same last user message across several generation spans. With non-cumulative SDKs each generation carries only the current message, so two spans with identical content are two genuine turns. Detect this per generation from the input history: a single-message input is non-cumulative and is never deduplicated, while cumulative inputs keep the existing content dedup plus a user-message-count check so genuine repeats in a cumulative history are preserved too. The same single-message gate is applied to assistant messages so an identical answer to a repeated question still shows. Refs TET-2602 Co-Authored-By: Claude <noreply@anthropic.com>
The single-message gate must not apply to assistant messages: a non-cumulative SDK can emit the same assistant output across two spans within one turn, and that duplicate still needs collapsing. Keep the original global assistant dedup and scope the fix to user messages only. Also fold the overlapping dedup test cases into it.each tables and tighten the comments. Refs TET-2602 Co-Authored-By: Claude <noreply@anthropic.com>
The MessagesPanel dedup test encoded the old single-message collapse. Reshape it to the cumulative tool-loop case, where deduplicating a replayed last user message is still correct. Refs TET-2602 Co-Authored-By: Claude <noreply@anthropic.com>
Refs TET-2602 Co-Authored-By: Claude <noreply@anthropic.com>
…ssage-does-not-show-up
Member
|
|
A non-cumulative SDK that prepends a system prompt sends [system, user] every turn. The previous code counted all messages including system, so totalMessageCount > 1 marked these as cumulative — causing genuine repeated user messages to be dropped by content-dedup. Exclude system messages from the count so [system, user] is correctly recognised as single-message (non-cumulative) input. Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
vgrozdanic
approved these changes
Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A user message sent twice in separate turns was dropped from the transcript, even though it shows as two spans in the timeline.
User messages were deduplicated purely by content. That is only correct for cumulative SDKs, where a tool loop replays the same last message across spans in one turn. Non-cumulative SDKs send only the current message, so two spans with the same text are two genuine turns.
The fix deduplicates per generation based on
gen_ai.input.messages: a single-message (non-cumulative) input is always kept, while cumulative inputs keep the existing dedup plus a user-message-count check for genuine repeats. Assistant dedup is unchanged, since duplicate assistant output within one turn still needs collapsing.Fixes TET-2602