Repository navigation
fix(conversations): Stop rewriting input Messages that did not change - #4127
Merged
Merged
Conversation
A Turn wrote message_updated rows with the same text for each input Message. One came from meta keys set to undefined in memory, which stored meta never has. The other came from the replied flag, which message_handled already records. Compare the canonical stored state without replied, and key the update on that same state. Co-Authored-By: David Cramer <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
513 screenshot changes — 0 changed · 513 added · 0 removed |
dcramer
reviewed
Nov 23, 2026
Add loadEventsOfType for history reads by event type, build the existing subagent and message loaders on it, and add expectNoMessageRewrites for the regression check.
dcramer
approved these changes
Nov 23, 2026
22 tasks done
This was referenced Nov 24, 2026
sentry-junior Bot
added a commit
that referenced
this pull request
Nov 24, 2026
A real web Turn saves its first input with replied: false. Since #4127, no message_updated row flips it to true, because message_handled records the reply. Loaded web history saved the input without replied, so the history eval saw a different first row. Co-Authored-By: David Cramer <[email protected]>
dcramer
added a commit
that referenced
this pull request
Nov 24, 2026
…4175) A real web Turn saves its first input with `replied: false`. Before #4127, a later `message_updated` row set `replied: true` for both real and loaded history, so their rows matched. #4127 stopped writing that row, because `message_handled` already records the reply. Loaded web history saved the input without `replied`, so its first row no longer matches a real Turn. The history fixture now builds loaded web inputs with the Turn's own helpers. `buildWebInboundMessage` makes the mailbox Message, and `webTurnInputMessages` makes the transcript Message. Two rules that the Turn applied inline now live in those helpers, so the Turn and the fixture share them: the first input is saved unreplied, and `webMessageAuthor` sets the web author shape. The fixture also resolves the author identity, as web ingress does. Without that identity, the store fills it in on read, and the next save writes a `message_updated` row whose meta has no `replied`. When a row differs, the eval's failure message now also shows the raw `message` and `message_updated` rows behind it. The `evals-integration.yml` path filter now also lists `packages/junior/src/chat/conversations/**`, because changes to Conversation storage can break these fixtures. <!-- junior-request-attribution:start --> via @dcramer. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3Aa91d67ef080a29e296a5698d03f64e43 --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3Aa91d67ef080a29e296a5698d03f64e43) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Aa91d67ef080a29e296a5698d03f64e43/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: David Cramer <[email protected]>
This branch was successfully deployed
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.
Each input Message of a Turn, such as a Watch Event or a parent task, got
message_updatedrows with the same text.Two causes in
appendConversationMessages:undefined(for exampleeventObjectTypeandskippedReason). Stored meta never has them, soisDeepStrictEqualsaw a change.canonicalJsondrops undefined, so the update hashed to the same idempotency key and landed once per Message.repliedfalse→true flip wrote an update, butmessage_handledalready records it and the projection derivesrepliedfrom it.The fix compares the canonical stored state without
repliedand uses that same state for the update's idempotency key.via @dcramer.
--
View Session [Sentry]