Repository navigation
fix(config): default to claude-sonnet-5-5 - #276
Conversation
Anthropic retires Claude Sonnet 4.5 (claude-sonnet-4-5-20250929) on the Claude API on November 30, 2026. Move the built-in defaults (--model flag, SDK default, GitHub workflow default, auth login --set-default, and the sample config) to anthropic/claude-sonnet-5-5. Add tests that fail if any built-in default is missing from the model catalog or marked deprecated there. Co-Authored-By: Claude Opus 5.5 <[email protected]>
validateModelConfig cleared only temperature for models whose catalog entry has temperature: false. An explicit --top-p or --top-k was still sent, and with --temperature plus --top-p the conflict check then saw no temperature and kept top_p. claude-sonnet-5-5, the new default, rejects all three with a 400 error, so clear them together. Add NewEmbeddedModelsRegistry, which builds the registry from the embedded catalog only, and use it in the default-model tests so a local `kit update-models` cache can't change their result. Co-Authored-By: Claude Opus 5.5 <[email protected]>
CreateProvider applied modelSettings after validateModelConfig, so a per-model temperature, topP or topK for a model that rejects them (such as claude-sonnet-5-5) was restored after it had been cleared. Run the validation after ApplyModelSettings instead. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…er test CreateProvider reads the global registry, which merges the local `kit update-models` cache. Point it at the embedded catalog for both Sonnet 5.5 sampling tests, through a small helper, so a local cache can't change their result. Co-Authored-By: Claude Opus 5.5 <[email protected]>
validateModelConfig cleared top_p and top_k for every model with Temperature false. A custom model that omits the "temperature" key (or a catalog entry without it) also reads as false, so user-set params.topP / params.topK were silently dropped. Add ModelInfo.SamplingUnsupported, set only for catalog entries with an explicit "temperature": false (modelsDBModel.Temperature is now *bool to tell omitted from false). Clear top_p/top_k only for those models; still clear temperature when it is unsupported. Report on stderr each cleared value that the user set (flag, env, global config, modelSettings or custom model params); built-in defaults are cleared without a warning. Refs mark3labs#275 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Connected to Huly®: KIT-277 |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Fixes #275
This replaces #273, which was closed automatically because it had no linked issue. The code is the same as in #273, rebased on current
master, plus a fix for the last open CodeRabbit comment there.Summary
Anthropic retires Claude Sonnet 4.5 (
claude-sonnet-4-5-20250929) on the Claude API on November 30, 2026, and listsclaude-sonnet-5-5as the replacement (model deprecations). Kit's built-in defaults still point at Sonnet 4.5, so after that datekitwithout--modelormodel:fails on the first request.What changed
Default model →
anthropic/claude-sonnet-5-5in:cmd/root.go: the--model/-mflag defaultpkg/kit/config.go: the SDK default (setSDKDefaults)cmd/github.go:defaultGitHubModelcmd/auth.go: the model thatauth login anthropic --set-defaultwritesinternal/config/config.go: the commentedmodel:line in the sample configNew tests (
cmd/default_model_test.go,pkg/kit/default_model_test.go) look up each built-in default in the embedded catalog (models.NewEmbeddedModelsRegistry(), so a localkit update-modelscache can't change the result) and fail if it is missing or deprecated.Sampling parameters.
claude-sonnet-5-5rejectstemperature,top_pandtop_kwith HTTP 400. Before,validateModelConfigcleared onlytemperature, so--top-p/--top-k(or atop_pthat the temperature/top_p conflict check kept) still reached the model."temperature": falseare now markedSamplingUnsupported, and for themtemperature,top_pandtop_kare all cleared.CreateProviderrunsvalidateModelConfigafterApplyModelSettings, so amodelSettingsentry can't bring the values back.CodeRabbit follow-up from #273 (don't silently drop
top_p/top_kon custom models):top_pandtop_kare cleared only when the model metadata explicitly marks sampling unsupported. Custom models (where an omittedtemperaturekey reads asfalse) and the ~350 catalog entries that omit thetemperaturekey keep them. To tell "omitted" from "false",modelsDBModel.Temperatureis now a*bool. Onlytemperatureis still cleared for those models, as onmaster.modelSettings, or custom modelparams) is cleared, Kit prints one warning on stderr, for example:Warning: anthropic/claude-sonnet-5-5 does not support top_p, top_k; ignoring the configured value. Built-in flag defaults (0.7 / 0.95 / 40) are cleared without a warning, so a plainkitrun stays quiet.ApplyModelSettingsand the new check share one lookup helper,modelLevelParams.The two other earlier CodeRabbit points still hold after the rebase: the Sonnet 5.5
CreateProvidertests use an embedded-only global registry (useEmbeddedGlobalRegistry), and validation still runs afterApplyModelSettings.Left unchanged on purpose: README,
www/docs,skills/, godoc examples and thekit githubhelp text still mentionclaude-sonnet-4-5as an example. The per-model example in the sample config (claude-sonnet-4-5withtemperature: 0.3) is also unchanged, because renaming it to 5.5 would show a setting that model rejects. I can send the docs update as a follow-up.Testing
Run locally on Windows with Go 1.27.4 and golangci-lint v2.14.0 (the CI versions):
go vet ./...is clean.gofmtis clean on every changed file (checked with CRLF stripped; my checkout usescore.autocrlf).golangci-lint run ./...: no findings in changed code. The only non-gofmt findings are 8unusedhits ininternal/daemonthat appear only on a Windows build; the gofmt findings are CRLF line endings.internal/modelspass, including the newTestCustomModelKeepsTopPAndTopK,TestClearUnsupportedSamplingReportsUserValuesandTestCatalogOmittedTemperatureKeepsTopP.TestDefaultModelsAreCurrentandTestSDKDefaultModelIsCurrentpass.params.topP/params.topKwere cleared without warning. This change keeps them.go test ./...has failures on Windows, but the set of failing tests is identical on an unmodifiedmastercheckout (54 entries on both, none new). They are Windows path, permission and terminal tests (for exampleTestAtomicCacheReaders,TestEnsureConfigExists), plus 15-minute timeouts incmdandinternal/ui. I rely on the Linux CI for the full suite.go test -racewas not run: this machine has no C compiler.🤖 Generated with Claude Code
Summary by CodeRabbit