Repository navigation
chore(core): upgrade to @anthropic-ai/sdk 1.x and stop sending temperature to Claude - #357
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces #344. Dependabot's bump didn't update the lockfile, and SDK 1.x doesn't type-check against the Claude provider.
SDK 1.x sends
anthropic-version: 2026-10-21instead of2023-06-01, which isn't only a types change. Per Anthropic's version notes and migration guide, on the Messages API:temperature,top_pandtop_kare removed, and sending any of them is a 400 on every model. This one affects us.documentblock directly in an assistant message is a 400. We never send one.textblocks in a user message are a 400. We never send citations in history; history goes back as text, thinking, tool use and tool results only.Changes
@anthropic-ai/sdk^0.135.0to^1.2.0, with the lockfile.temperatureis never sent to Claude. A configured value logs one warning and is left out. Before, it was only left out for models that already rejected it (Claude 4.7+, 5.x, Fable, Mythos), including our defaultclaude-haiku-5-5, so for most setups nothing changes. On Claude 4.6 and older, a loweredtemperatureno longer has an effect. The guide says no setting replaces it, and the warning points toeffort. The changeset and the provider docs say this.MessageParamis now a union that includes asystemrole. The message builder types its roles as'user' | 'assistant', which is what it always produced.claudeRejectsTemperaturestays exported but unused by the provider, with a comment, so nothing that imports it breaks.Live check
I re-recorded every Claude fixture against the real API with the new SDK (
scripts/record-fixtures.mjs claude, a few cents):max_tokensstopAll recorded fine. The thinking case needed one retry: with
effort: "high"the model decides whether to think, and once it didn't. All tests pass on the new recordings, and no key appears in them.Checks: build, typecheck, lint (41, same as
dev), publint, coverage (1,250 tests), the docs check and the website build.