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.
π« fix: Preserve Loaded Message Content When Resume Snapshot Is Empty #14399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
π« fix: Preserve Loaded Message Content When Resume Snapshot Is Empty #14399
Changes from 1 commit
bbe97857915c159a3beebFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a user reloads during an in-flight regenerate before the new run has aggregated any content, the server can report an empty
aggregatedContentwith a paddedresponseMessageId, while the loaded DB history still contains the old assistant response under the same parent. This fallback can select that old response, and this line now seedssyncStepMessagewith its old content; subsequent text deltas append to that stale answer instead of starting the regenerated response from blank.Useful? React with πΒ / π.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, fixed in 7915c15.
You're right that the parent-based fallback can land on the answer being regenerated: it matches any
!isCreatedByUserrow whoseparentMessageId === userMsgId, and on a regenerate the new run'sresponseMessageIdisn't in the loaded history yet, so that fallback is exactly what fires.Preservation is now scoped to rows matched by the server's declared
responseMessageId, which is the only case that proves the row belongs to this generation:A fallback-matched row keeps the previous clear-on-empty behavior, so a regenerated run still starts blank. This also keeps the original fix effective for the case it targets, since a resumed placeholder and a persisted partial both carry the server's response id.
Added
does not preserve content on a row matched only by the parent fallbackto cover it; verified it fails against the previous version of the guard and passes now.Uh oh!
There was an error while loading. Please reload this page.