Skip to content

fix(provider/anthropic): preserve streamObject deltas with thinking#12591

Open
giulio-leone wants to merge 1 commit intovercel:mainfrom
giulio-leone:codex/issue-12427-stream-object-thinking
Open

fix(provider/anthropic): preserve streamObject deltas with thinking#12591
giulio-leone wants to merge 1 commit intovercel:mainfrom
giulio-leone:codex/issue-12427-stream-object-thinking

Conversation

@giulio-leone
Copy link

@giulio-leone giulio-leone commented Feb 14, 2026

Summary

  • emit text-delta for JSON tool outputs when Anthropic sends full JSON only in content_block_start.input
  • keep existing input_json_delta behavior, but fall back to start-input emission when deltas are absent
  • add regression coverage for thinking + structured output (jsonTool) streaming path

Validation

  • pnpm --filter @ai-sdk/anthropic exec vitest --config vitest.node.config.js --run src/anthropic-messages-language-model.test.ts
  • pnpm --filter @ai-sdk/anthropic exec eslint src/anthropic-messages-language-model.ts src/anthropic-messages-language-model.test.ts
  • pnpm --filter @ai-sdk/anthropic type-check
  • repeated the same validation suite twice consecutively with zero failures

Closes #12427

Attribution request

If this pull request is merged, I would be grateful if contributor credit could be included in the related changelog or release notes for implementing this fix (@g97iulio1609).

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.

streamObject doesn't stream when Anthropic extended thinking is enabled

1 participant