Repository navigation
fix: drop retired Claude models and validate model server-side - #250
Open
travismarceau wants to merge 1 commit into
Open
travismarceau wants to merge 1 commit into
travismarceau wants to merge 1 commit into
Conversation
Anthropic reports requests from Fragments to claude-3-7-sonnet-latest, retired 2026-02-19. The ID was removed from models.json in 86b5f52, but /api/chat and /api/morph-chat trust the model object sent by the client, so stale tabs and scripts still reach retired models. - Resolve the requested model against models.json on the server and fall back to the default when it is not listed. - Replace the Anthropic entries with one alias per family: claude-opus-4-6, claude-sonnet-4-6, claude-haiku-4-5. Removes retired claude-3-5-haiku-latest and claude-opus-4-1, and deprecated Opus 4 / Sonnet 4. - Define the default model once (lib/default-model.ts). Sonnet 5+ is not included: ai@3 always sends temperature: 0 and a forced tool_choice for streamObject/generateObject, which those models reject. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Why
Anthropic reports that the
artifacts.e2b.devkey is still sending requests toclaude-3-7-sonnet-latest, which was retired on 2026-02-19. These requests fail withnot_found_error; there were 3 on 2026-09-27.The ID was removed from
lib/models.jsonin 86b5f52, but/api/chatand/api/morph-chatuse themodelobject sent by the client without checking it. The client resets a saved model only when the page loads, so stale tabs, cached pages, and scripts calling the API directly still reach retired models.What
resolveModel()inlib/models.tslooks up the requested ID inmodels.jsonand falls back to the default model (with aconsole.warn) when the ID isn't listed. Both API routes now use it.claude-opus-4-6,claude-sonnet-4-6,claude-haiku-4-5. These aliases pick up new snapshots within their family.claude-3-5-haiku-latest(2026-02-19) andclaude-opus-4-1-20250805(2026-08-05).claude-opus-4-20250514andclaude-sonnet-4-20250514.lib/default-model.ts. It's a separate file so the client page doesn't bundle every provider SDK.Non-Anthropic entries are unchanged.
Why not Sonnet 5 / 5.5
[email protected]+@ai-sdk/[email protected]always sendtemperature: 0andtool_choice: {type: "tool", name: "json"}forstreamObject/generateObject(confirmed by capturing the request body). Sonnet 5 and Opus 5 rejecttemperature, and the 5.5 models also reject forcedtool_choice. Moving to the 5.x models needs an AI SDK upgrade, which should be a separate PR.Verification
tsc --noEmit,next lint, andnext buildpass. Lint warnings are unchanged frommain.fetch:claude-3-7-sonnet-latest,claude-3-5-haiku-latest,claude-opus-4-1-20250805, and a missing ID resolve toclaude-sonnet-4-6.claude-opus-4-6,claude-haiku-4-5, andgpt-4opass through unchanged.claude-3-7-sonnet-latestsendsmodel: "claude-sonnet-4-6".🤖 Generated with Claude Code