Skip to content

fix(config): default to claude-sonnet-5-5 - #276

Merged
ezynda3 merged 5 commits into
mark3labs:masterfrom
prasadrandika:fix/default-sonnet-5-5
Nov 23, 2026
Merged

ezynda3 merged 5 commits into
mark3labs:masterfrom
prasadrandika:fix/default-sonnet-5-5

Conversation

@prasadrandika

@prasadrandika prasadrandika commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

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 lists claude-sonnet-5-5 as the replacement (model deprecations). Kit's built-in defaults still point at Sonnet 4.5, so after that date kit without --model or model: fails on the first request.

What changed

Default model → anthropic/claude-sonnet-5-5 in:

  • cmd/root.go: the --model / -m flag default
  • pkg/kit/config.go: the SDK default (setSDKDefaults)
  • cmd/github.go: defaultGitHubModel
  • cmd/auth.go: the model that auth login anthropic --set-default writes
  • internal/config/config.go: the commented model: line in the sample config

New 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 local kit update-models cache can't change the result) and fail if it is missing or deprecated.

Sampling parameters. claude-sonnet-5-5 rejects temperature, top_p and top_k with HTTP 400. Before, validateModelConfig cleared only temperature, so --top-p / --top-k (or a top_p that the temperature/top_p conflict check kept) still reached the model.

  • Catalog entries with an explicit "temperature": false are now marked SamplingUnsupported, and for them temperature, top_p and top_k are all cleared.
  • CreateProvider runs validateModelConfig after ApplyModelSettings, so a modelSettings entry can't bring the values back.

CodeRabbit follow-up from #273 (don't silently drop top_p/top_k on custom models):

  • top_p and top_k are cleared only when the model metadata explicitly marks sampling unsupported. Custom models (where an omitted temperature key reads as false) and the ~350 catalog entries that omit the temperature key keep them. To tell "omitted" from "false", modelsDBModel.Temperature is now a *bool. Only temperature is still cleared for those models, as on master.
  • When a value that the user set (flag, env, global config, modelSettings, or custom model params) 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 plain kit run stays quiet.
  • ApplyModelSettings and the new check share one lookup helper, modelLevelParams.

The two other earlier CodeRabbit points still hold after the rebase: the Sonnet 5.5 CreateProvider tests use an embedded-only global registry (useEmbeddedGlobalRegistry), and validation still runs after ApplyModelSettings.

Left unchanged on purpose: README, www/ docs, skills/, godoc examples and the kit github help text still mention claude-sonnet-4-5 as an example. The per-model example in the sample config (claude-sonnet-4-5 with temperature: 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.
  • ✅ gofmt is clean on every changed file (checked with CRLF stripped; my checkout uses core.autocrlf).
  • ✅ golangci-lint run ./...: no findings in changed code. The only non-gofmt findings are 8 unused hits in internal/daemon that appear only on a Windows build; the gofmt findings are CRLF line endings.
  • ✅ All sampling and model-settings tests in internal/models pass, including the new TestCustomModelKeepsTopPAndTopK, TestClearUnsupportedSamplingReportsUserValues and TestCatalogOmittedTemperatureKeepsTopP.
  • ✅ TestDefaultModelsAreCurrent and TestSDKDefaultModelIsCurrent pass.
  • ✅ A probe test on the previous branch tip confirms the bug that CodeRabbit found: a custom model's params.topP / params.topK were cleared without warning. This change keeps them.
  • ⚠️ go test ./... has failures on Windows, but the set of failing tests is identical on an unmodified master checkout (54 entries on both, none new). They are Windows path, permission and terminal tests (for example TestAtomicCacheReaders, TestEnsureConfigExists), plus 15-minute timeouts in cmd and internal/ui. I rely on the Linux CI for the full suite.
  • ⚠️ go test -race was not run: this machine has no C compiler.
  • ⚠️ Not tested against the real Anthropic API (no API key).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Updates
    • Anthropic’s default model is now Claude Sonnet 5.5 across the command-line interface, GitHub workflows, generated configuration, and SDK.
  • Bug Fixes
    • Unsupported sampling settings, such as temperature, top-p, and top-k, are now cleared when configuring a model. You’ll receive a warning when a setting you provided is cleared; built-in defaults are adjusted without a warning.

prasadrandika and others added 5 commits November 23, 2026 18:47
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]>
@mark-iii-labs-huly

Copy link
Copy Markdown

Connected to Huly®: KIT-277

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The CLI, GitHub workflow, generated configuration, and SDK defaults now use Claude Sonnet 5.5. Model registry metadata and provider validation handle unsupported sampling parameters. New tests check the defaults against the embedded catalog and cover sampling-parameter cleanup.

Changes: Model defaults and sampling validation

Layer / File(s) Summary
Catalog metadata and embedded registry
internal/models/modelsdb.go, internal/models/registry.go, internal/models/sampling_params_test.go
The registry distinguishes catalog entries with explicitly unsupported temperature from entries that omit temperature metadata. A new embedded-only registry excludes cached providers, custom models, and provider overrides.
Provider sampling parameter handling
internal/models/custom.go, internal/models/providers.go, internal/models/sampling_params_test.go
Provider setup applies model-level generation settings before validation. Validation clears unsupported sampling parameters and reports cleared values supplied through user configuration or model settings. Tests cover supported and unsupported models and value reporting.
Default model values and current-model tests
cmd/auth.go, cmd/github.go, cmd/root.go, cmd/default_model_test.go, internal/config/config.go, pkg/kit/config.go, pkg/kit/default_model_test.go
CLI, GitHub workflow, generated configuration, and SDK defaults change to Claude Sonnet 5.5. Tests check that CLI and SDK defaults are present and not deprecated in the embedded catalog.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant CreateProvider
  participant ApplyModelSettings
  participant modelLevelParams
  participant validateModelConfig
  participant clearUnsupportedSampling
  CreateProvider->>ApplyModelSettings: Apply per-model generation settings
  ApplyModelSettings->>modelLevelParams: Resolve model parameters
  CreateProvider->>validateModelConfig: Validate configuration after settings
  validateModelConfig->>clearUnsupportedSampling: Clear unsupported sampling parameters
Loading

Possibly related PRs

  • mark3labs/kit#273: This PR changes the same defaults and adds sampling-parameter cleanup for models that reject those parameters.

Suggested reviewers: ezynda3

Merge Risk: Minimal · up to 5bb1a

This change moves the default model to Claude Sonnet 5.5 and drops sampling parameters that the model rejects. The reviewed paths show no concrete merge-blocking defect. The remaining gaps are a real API test and a Linux full-suite run in CI.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix(config): default to claude-sonnet-5-5" names the main change. The PR changes the built-in Anthropic default model from claude-sonnet-4-5-20250929 to claude-sonnet-5-5 across the CLI fla…
Linked Issues check Passed Issue #275 has two coding requirements. (1) Replace the built-in Sonnet 4.5 default with anthropic/claude-sonnet-5-5. The PR changes all five named locations: the --model flag default in cmd/root.go, …
Out of Scope Changes check Passed Every changed file maps to an objective of #275 or to a test or helper that supports one. The changed files are the five default locations, the modelsDBModel.Temperature type change to *bool, the Mode…
Full details: Title check

Explanation

The title "fix(config): default to claude-sonnet-5-5" names the main change. The PR changes the built-in Anthropic default model from claude-sonnet-4-5-20250929 to claude-sonnet-5-5 across the CLI flag, SDK, GitHub workflow, auth default, and sample config. The title is concise, specific, and follows a conventional commit style. The sampling-parameter cleanup and registry changes are secondary and not named, which is acceptable because the title does not need to cover every detail.

Full details: Linked Issues check

Explanation

Issue #275 has two coding requirements. (1) Replace the built-in Sonnet 4.5 default with anthropic/claude-sonnet-5-5. The PR changes all five named locations: the --model flag default in cmd/root.go, setSDKDefaults in pkg/kit/config.go, defaultGitHubModel in cmd/github.go, the auth login --set-default model in cmd/auth.go, and the commented model line in internal/config/config.go. New tests TestDefaultModelsAreCurrent and TestSDKDefaultModelIsCurrent check that each default exists in the embedded catalog and is not deprecated. (2) Handle Sonnet 5.5 rejection of temperature, top_p and top_k without silently dropping user-set top_p/top_k on custom models. The providers.go diff shows that validateModelConfig now runs after ApplyModelSettings. clearUnsupportedSampling clears temperature when the model does not support it. It clears top_p and top_k only when ModelInfo.SamplingUnsupported is true, which is set only for an explicit "temperature": false in the catalog. Custom models and entries with an omitted key keep top_p and top_k. User-set values that are cleared produce a stderr warning. Tests in internal/models/sampling_params_test.go cover these cases. Limits: I read the providers.go diff only. I did not run the tests, and the PR reports that they pass. The registry, modelsdb and custom.go changes were taken from the summary.

Full details: Out of Scope Changes check

Explanation

Every changed file maps to an objective of #275 or to a test or helper that supports one. The changed files are the five default locations, the modelsDBModel.Temperature type change to *bool, the ModelInfo.SamplingUnsupported field, the NewEmbeddedModelsRegistry constructor, the modelLevelParams helper, the reordered validation in createProvider, the warning path, and the new tests. The shared helper modelLevelParams serves both ApplyModelSettings and the new check, so it is in scope. The PR leaves docs, skills and godoc examples unchanged. #275 does not request documentation changes, so this is not a gap. No unrelated change was found in the reviewed evidence.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fbe9be07-1bd4-4a00-8590-8ca02a7bf532
Commits

Reviewing files that changed from the base of the PR and between e33c53a and 5bb1a88.

Files selected for processing: 12

  • cmd/auth.go
  • cmd/default_model_test.go
  • cmd/github.go
  • cmd/root.go
  • internal/config/config.go
  • internal/models/custom.go
  • internal/models/modelsdb.go
  • internal/models/providers.go
  • internal/models/registry.go
  • internal/models/sampling_params_test.go
  • pkg/kit/config.go
  • pkg/kit/default_model_test.go

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@ezynda3 ezynda3 added status: need maintainer response Waiting for response from a maintainer triage: ci needs review CI is waiting for approval and was not auto-approved type: bug Something isn't working as expected status: ready for review CI green, no blocking feedback — ready for maintainer review and removed status: need maintainer response Waiting for response from a maintainer status: ready for review CI green, no blocking feedback — ready for maintainer review triage: ci needs review CI is waiting for approval and was not auto-approved labels Nov 23, 2026
@ezynda3
ezynda3 merged commit 5d07c49 into mark3labs:master Nov 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: ready for review CI green, no blocking feedback — ready for maintainer review type: bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: default model claude-sonnet-4-5 retires on Nov 30, 2026

2 participants