Conversation
🦋 Changeset detectedLatest commit: d8895f7 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
I think I handled this in my pr, can you check? |
|
Oh this is different |
commit: |
Yes, I think your PR is missing data parts but you have added a compression for messages too large and I added a simpler size check to skip persistence. Should I remove that? |
|
Yeah don't skip persistence |
|
/bonk review this PR |
|
Now I have a thorough understanding of the PR. Here's my review: PR Review: Handle data parts in AIChatSummaryThis PR adds server-side persistence for Core SDK Changes (
|
|
/bonk review again |
|
Good. Now I have a full picture. Let me write the review. PR Review: Handle data parts in AIChat (re-review)Previous blocker — resolvedThe Remaining issues1. Stray whitespace change (nit) The diff removes a blank line between 2. Transient parts are still broadcast AND stored as stream chunks Transient parts are correctly excluded from 3. The cast at line 1777 is still there. // Cast needed because UIMessage["parts"] doesn't include data-* part shapes.
// Safe at runtime — parts is a plain array and data-* types are pass-through.4. The find predicate at line 1764: (p) =>
p.type === dataChunk.type &&
"id" in p &&
(p as { id?: string }).id === dataChunk.idThe const existing = message.parts.find(
(p) =>
p.type === dataChunk.type &&
"id" in p &&
(p as Record<string, unknown>).id === dataChunk.id
);Or just cast once at the top since you're already in the Example changes — look good
One observation: the VerdictNo blockers remaining. The main feedback from the previous review (skip persistence) has been addressed. The remaining items are minor — the |
Adds support for
data-*stream chunks inAIChatAgent._streamSSEReply, which were previously ignored. Data parts are developer-defined typed JSON blobs that the AI SDK attaches to messages alongside text.What changed:
Closes #575