Skip to content

fix(anthropic): allow null content in compaction/compaction_delta schemas#12604

Open
giulio-leone wants to merge 2 commits intovercel:mainfrom
giulio-leone:fix/issue-12470-compaction-delta-null
Open

fix(anthropic): allow null content in compaction/compaction_delta schemas#12604
giulio-leone wants to merge 2 commits intovercel:mainfrom
giulio-leone:fix/issue-12470-compaction-delta-null

Conversation

@giulio-leone
Copy link

Fixes #12470

giulio-leone and others added 2 commits February 14, 2026 22:05
…emas

Fixes vercel#12470 - Anthropic API can send compaction_delta events with
content: null (e.g. initial frame before compaction summary text).

Changes:
- Update compaction_delta schema to use z.string().nullish()
- Update non-streaming compaction schema to use z.string().nullish()
- Add null guards in both streaming and non-streaming consumers
- Consistent with content_block_start compaction schema (already nullish)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@giulio-leone giulio-leone force-pushed the fix/issue-12470-compaction-delta-null branch from f652226 to 46974e3 Compare February 14, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

compaction_delta streaming Zod schema rejects content: null from Anthropic API

1 participant