Skip to content

fix(mcp): replace retired claude-sonnet-4-5 as the default Anthropic model - #1754

Merged
MathurAditya724 merged 7 commits into
getsentry:mainfrom
pcbeingused333:fix/anthropic-default-model
Nov 17, 2026
Merged

MathurAditya724 merged 7 commits into
getsentry:mainfrom
pcbeingused333:fix/anthropic-default-model

Conversation

@pcbeingused333

@pcbeingused333 pcbeingused333 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Anthropic retires claude-sonnet-4-5 on 2026-11-30 (model deprecations). After that date, embedded agents fail with a model-not-found error unless ANTHROPIC_MODEL is set. This PR switches the default to claude-sonnet-5-5, Anthropic's recommended replacement.

Changes

  • Default model: claude-sonnet-5-5 in the provider constant, its doc comment, the sentry mcp --anthropic-model usage text and the mcp.md skill reference.
  • @ai-sdk/anthropic ^3.0.33 → ^3.0.137 (current ai-v6 tag). This bump is required. 3.0.33 doesn't know claude-sonnet-5-5, so it handles Output.object with a hidden json tool and sends tool_choice: {type: "any"} on every step, including the toolChoice: "none" finalize step. It also caps max_tokens at 4096. Sonnet 5.5 rejects forced tool choice with a 400, so every Anthropic-backed embedded agent call would fail. 3.0.137 knows the model: it sends tool_choice as auto, or none on the finalize step, uses native output_config.format for structured output, sends no sampling params, sets max_tokens: 128000, and passes thinking blocks back unchanged in the tool loop.
  • Docs: fixed the stale Anthropic default in docs/operations/embedded-agents.md.

Verification

  • Captured the request bodies through a mocked fetch, using the same generateText + Output.object + prepareStep setup as callEmbeddedAgent, on both SDK versions (results above).
  • pnpm run tsc, pnpm run lint and the @sentry/mcp-core tests pass.

Behavior note

Sonnet 5.5 runs adaptive thinking by default. The Anthropic provider passes no provider options, so embedded agent steps may use more tokens and take longer than on 4.5. Setting thinking: { type: "between_tools" } would turn off up-front thinking if that matters. It's left out of this PR.

Drafted with Claude Code assistance.

via @BYK.

--

View Session in Sentry

…model

Anthropic retires claude-sonnet-4-5 on 2026-11-30, after which the embedded
agents fail with a model-not-found error unless ANTHROPIC_MODEL is set. Use
claude-sonnet-5-5 as the default and update the CLI usage text. No sampling
parameters are sent, so the new model needs no other change.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Alex Castillo <[email protected]>
@vercel

vercel Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Nov 2, 2026 1:53pm UTC

Request Review

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Oct 30, 2026

// Default configuration constants
const DEFAULT_ANTHROPIC_MODEL = "claude-sonnet-4-5";
const DEFAULT_ANTHROPIC_MODEL = "claude-sonnet-4-6";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not 5.5?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests in this file are garbage

pcbeingused333 and others added 2 commits October 30, 2026 16:19
Review feedback: use the newest Sonnet instead of 4-6, and keep only the
default-model test (the ANTHROPIC_MODEL cases exercise the SDK, not this code).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Alex Castillo <[email protected]>
It only pinned the constant.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Signed-off-by: Alex Castillo <[email protected]>
@pcbeingused333

Copy link
Copy Markdown
Contributor Author

Switched to claude-sonnet-5-5. Dropped the test file: pinning the constant adds nothing.

This comment was drafted with Claude Code.

@BYK
BYK enabled auto-merge (squash) October 30, 2026 20:53
…lt-model

# Conflicts:
#	packages/mcp-server/src/cli/usage.ts
auto-merge was automatically disabled November 2, 2026 13:53

Head branch was pushed to by a user without write access

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 494708e. Configure here.

@ai-sdk/anthropic 3.0.33 does not know claude-sonnet-5-5. It treats it as
an unknown model, so structured output falls back to a hidden json tool
with tool_choice {type: "any"} on every step and max_tokens 4096. Sonnet
5.5 rejects forced tool choice with a 400, so every Anthropic-backed
embedded agent call would fail.

3.0.137 (latest ai-v6) knows the model: it sends native
output_config.format, tool_choice auto, no sampling params, and a 128k
max_tokens. Also fix the stale Anthropic default in embedded-agents.md.

Co-Authored-By: BYK <[email protected]>
@vercel

vercel Bot commented Nov 2, 2026

Copy link
Copy Markdown

@sentry-junior[bot] is attempting to deploy a commit to the Sentry Team on Vercel.

A member of the Team first needs to authorize it.

@BYK
BYK enabled auto-merge (squash) November 2, 2026 14:24
BYK added a commit that referenced this pull request Nov 2, 2026
…1804)

Pull requests from forks always fail three `Test` jobs, `sentry`, `NPM
package (sentry)` and `CLI asset catalog (macOS arm64)`, plus the
aggregate `test` job. The cause isn't the PR's code:
`vars.SENTRY_CLIENT_ID` is empty on fork `pull_request` runs, so
`packages/cli/script/build.ts` and `bundle.ts` exit with
`SENTRY_CLIENT_ID environment variable is required`.

Evidence:
- In the #1754 run
[41461213614](https://github.com/getsentry/toolkit/actions/runs/41461213614),
the step env shows `SENTRY_CLIENT_ID:` with no value, and all three jobs
stop on that error.
- The other recent fork runs that included the CLI,
[41430282402](https://github.com/getsentry/toolkit/actions/runs/41430282402)
and
[41122572999](https://github.com/getsentry/toolkit/actions/runs/41122572999),
fail the same jobs. Same-repo PR runs from the same day pass.

### Change

- In `test.yml`, `SENTRY_CLIENT_ID` now falls back to `test-client-id`
in the three CLI build jobs. Local E2E and the CLI unit tests already
use that placeholder. When the repository variable is set, it still
wins.
- `test.yml` uploads and publishes nothing, so the placeholder never
ships. Release builds go through `cli-build.yml`, which this PR doesn't
touch.
- `docs/operations/github-actions.md` gets a short note on the fallback.

### Verification

- Locally, `SENTRY_CLIENT_ID= pnpm --filter sentry run bundle`
reproduces the CI error. With `SENTRY_CLIENT_ID=test-client-id`, the
bundle completes.
- `pnpm run lint` and `pnpm run docs:check` pass.

After this merges, #1754 needs `main` merged in (or a new push) to pick
up the workflow change.

<!-- junior-request-attribution:start -->
via @BYK.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:local%3Aweb%3Ac7729b8a4160db0aeba2f707 -->

--

[View Session in
Sentry](https://sentry.sentry.io/explore/conversations/local%3Aweb%3Ac7729b8a4160db0aeba2f707/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: BYK <[email protected]>
auto-merge was automatically disabled November 17, 2026 19:09

Head branch was pushed to by a user without write access

@pcbeingused333
pcbeingused333 requested a review from a team as a code owner November 17, 2026 19:09
@MathurAditya724
MathurAditya724 enabled auto-merge (squash) November 17, 2026 19:22
@MathurAditya724
MathurAditya724 merged commit 0b93632 into getsentry:main Nov 17, 2026
33 of 34 checks passed
BYK added a commit that referenced this pull request Nov 17, 2026
…ry (#2352)

`pnpm-lock.yaml` on `main` points to
`@ai-sdk/[email protected]([email protected])`, but has no entry for it, so
pnpm rejects the lockfile as broken.

Two PRs merged one after the other, and each lockfile looked fine by
itself:

- #1754 bumped `@ai-sdk/anthropic` to `^3.0.137`. That
made `@ai-sdk/anthropic` and `@ai-sdk/gateway` depend on
`@ai-sdk/[email protected]`. That version was already in the
lockfile because `@mastra/core` pulled it in.
- #2322 removed `@mastra/core`. Its branch was cut
before #1754, so its lockfile dropped `[email protected]` and
`[email protected]`. Git merged the two lockfiles without a conflict, and
`main` was left pointing at entries that no longer exist.

This PR adds back the four missing entries: `packages` and `snapshots`
for `@ai-sdk/[email protected]` and `@ai-sdk/[email protected]`.
Nothing else in the lockfile changes, and Mastra stays out.

<!-- junior-request-attribution:start -->
via @BYK.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:local%3Aweb%3A720edeaf6006d91ce693aeda -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/local%3Aweb%3A720edeaf6006d91ce693aeda)
[[Sentry]](https://sentry.sentry.io/explore/conversations/local%3Aweb%3A720edeaf6006d91ce693aeda/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: BYK <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants