Skip to content

Commit 680f5fa

Browse files
authored
fix(agent): support Sonnet 5 output limits (#212)
## Why Claude Sonnet 5 was added to the product catalog while `@ai-sdk/anthropic` remained on 3.0.84, which does not recognize that model ID. The provider therefore applied its unknown-model 4,096-token compatibility limit. Sonnet 5 defaults to adaptive thinking, so long structured tool calls could be truncated before required fields such as file content were emitted. ## Decision Upgrade only `@ai-sdk/anthropic` within its existing 3.x major to 3.0.107. This version recognizes `claude-sonnet-5`, uses its documented 128K output capability, forwards current thinking controls, and remains compatible with the existing AI SDK 6 and Mastra 1 stack. No retry, prompt, schema, or runtime workaround is introduced. ## Architecture and migration effects - No architecture boundary changes - No database or migration changes - Lockfile-only transitive updates under the Anthropic provider ## Verification - `pnpm lint` - `pnpm typecheck` - `pnpm turbo build --force` - `pnpm deadcode` - `pnpm architecture:check` - `pnpm turbo skills:build` - Focused typechecks for `@cheatcode/agent-core` and `@cheatcode/agent-worker` - Captured the generated Sonnet 5 request with a mock transport and verified `model: claude-sonnet-5` and `max_tokens: 128000` Production flow QA will follow deployment.
1 parent 2ad76c6 commit 680f5fa

2 files changed

Lines changed: 37 additions & 9 deletions

File tree

pnpm-lock.yaml

Lines changed: 36 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ peerDependencyRules:
8282
'@ai-sdk/ui-utils@1.2.11>zod': '^4.0.0'
8383

8484
catalog:
85-
'@ai-sdk/anthropic': 3.0.84
85+
'@ai-sdk/anthropic': 3.0.107
8686
'@ai-sdk/deepseek': 2.0.39
8787
'@ai-sdk/openai': 3.0.71
8888
'@ai-sdk/react': 3.0.207

0 commit comments

Comments
 (0)