Skip to content

fix(agent): support Sonnet 5 output limits - #212

Merged
iamjr15 merged 1 commit into
mainfrom
fix/sonnet-5-tool-output
Aug 10, 2026
Merged

fix(agent): support Sonnet 5 output limits#212
iamjr15 merged 1 commit into
mainfrom
fix/sonnet-5-tool-output

Conversation

@iamjr15

@iamjr15 iamjr15 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

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.

@iamjr15
iamjr15 merged commit 680f5fa into main Aug 10, 2026
4 checks passed
@iamjr15
iamjr15 deleted the fix/sonnet-5-tool-output branch August 10, 2026 11:19
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.

1 participant