Repository navigation
fix(client): drop sampling params for the Claude 5 generation and Haiku 5.5 - #7014
Conversation
…ku 5.5 The Anthropic sampling restriction blankets every model released after Opus 4.6: the Messages API reference states those models "do not support" temperature/top_p beyond their backwards-compatible defaults (1.0 / >= 0.99), and the migration guides restate it per family — "Setting temperature, top_p, or top_k to any non-default value on Claude Opus 4.7 and later models, including Claude Opus 5.5, returns a 400 error" — covering the Claude 5 generation, Haiku 5.5 (defaults only: temperature 1, a lone top_p 0.99), and the Fable/Mythos lines. The gate only knew opus-4-7/4-8 and fable/mythos, so user-configured temperature/top_p reached Claude 5 and Haiku 5.5 models and 400'd the request. Dropping the params entirely is always safe; the gate extends its own family list and deliberately stays independent of model_supports_reasoning's exact-id list, which answers a different question (thinking capability, not sampling rejection). Pinned across opus-5(-5) plus a datestamped spelling, sonnet-5(-5), haiku-5-5, fable-5, and mythos-5, with the older opus-4-6/sonnet-4-6/ haiku-4-5 passthrough asserted. Docs re-checked 2026-10-08. Signed-off-by: asto <asto18089@126.com>
Maintainer follow-ups from the review of three merged contributor PRs from @asto18089. #7014 (Claude 5 sampling gate): the "never send both" assertion sat after the older-model loop, so it checked the first claude-opus-4-8 body, which never carries top_p, and could not catch a regression. It now runs inside the loop for each 4.x model, and a top_p-only request is checked to pass through, as the PR body described. #7015 (Kimi empty `items` repair): once an empty `items` is dropped, a required array with minItems >= 1 still failed mfjs_schema_can_terminate with InvalidSchemaNode, so that tool was still excluded. MFJS allows `items` to be absent, and an unconstrained array can always be satisfied, so absent `items` now counts as terminating. #7017 (era-scoped checkpoint recognition): the docs said an unstamped history "predates stamping". A session that has never been compacted has no stamped carrier either, so a pasted legacy header still reads as a checkpoint at a session's first compaction. SURVIVAL_CONTRACT.md and the history_is_post_provenance doc now state that limit. Refs #7014 Refs #7015 Refs #7017 Verified: scripts/dev-test.sh tui body_drops_sampling schema_sanitize moonshot kimi compaction: 355 run, 355 passed (includes body_drops_sampling_params_for_models_that_reject_them and 141 kimi/moonshot tests). validate_survival_contract.mjs: ok 17 fixtures. cargo fmt --check clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NBKbhx19BRbZtvWK8rVKjz
|
🤖 This reply is from Claude Opus 5.5, an AI agent working on behalf of the Codewhale maintainers. It is posted through @Hmbown's account, but Hunter did not write it. Merged in a3c3a8e. Thank you @asto18089. For routes without exact catalog facts, which covers custom or proxy base URLs, dated snapshot ids and Messages-wire gateways, this heuristic is the only thing that keeps One test follow-up on — Written by Claude Opus 5.5 (AI agent) on behalf of the maintainers. |
fix(client): capture and replay Anthropic redacted thinking blocks Merged locally because the PR conflicted with #7014 in one hunk of crates/tui/src/client/anthropic.rs (build_anthropic_body): this PR's non-native redacted_thinking withhold block sits directly above the sampling-parameters comment that #7014 rewrote. Resolution keeps both: the withhold block, then #7014's updated sampling comment. PR checks on its last head (5851b95): Lint, Test (ubuntu/macos/windows), npm wrapper smoke all passing. No-Issue: Anthropic redacted_thinking blocks were dropped and never replayed, so tool loops hit an unretryable 400. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NBKbhx19BRbZtvWK8rVKjz
Adds [Unreleased] entries for #7014, #7015, #7017, #7018, #7019 and #7020, crediting @asto18089 (and @zhuowp for the fork ports). Each merged without a changelog line. The entry for #7020 names its behavior change: the app-server's legacy [providers.custom] table now refuses a non-Chat wire with provider_wire_format_unsupported instead of forwarding a Chat body. Refs #7014 Refs #7015 Refs #7017 Refs #7018 Refs #7019 Refs #7020 Refs #6997 Verified: sync-changelog --check up to date; web check-facts OK; check-contributor-credit "Every contributor in the window is credited on all three surfaces". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NBKbhx19BRbZtvWK8rVKjz
What
anthropic_model_rejects_samplinggatestemperature/top_pout of Anthropic Messages bodies. The gate only knewopus-4-7,opus-4-8,fable, andmythos. Every model released after Opus 4.6 carries the same restriction — the Messages API reference states those models "do not support" settingtemperature/top_pbeyond their backwards-compatible defaults (temperature: 1.0,top_p >= 0.99), and the migration guides restate it per family: "Settingtemperature,top_p, ortop_kto any non-default value on Claude Opus 4.7 and later models, including Claude Opus 5.5, returns a 400 error". So user-configured sampling params reached the Claude 5 generation and Haiku 5.5 and returned a 400.The gate extends its own family list with
opus-5,sonnet-5, andhaiku-5substring arms. Dropping the params entirely is always safe; sending a forbidden one bricks the request. The gate deliberately stays independent ofmodel_supports_reasoning's exact-id list, which answers a different question (thinking capability, not sampling rejection).Pinned across opus-5(-5) plus a datestamped spelling, sonnet-5(-5), haiku-5-5, fable-5, and mythos-5, with the older opus-4-6 / sonnet-4-6 / haiku-4-5 passthrough asserted so a future over-broad arm like
contains("opus-4-")cannot slip through. Docs re-checked 2026-10-08.Tests
body_drops_sampling_params_for_models_that_reject_them: the eight Claude-5/Haiku-5.5/Fable/Mythos spellings must omit both params; older models keep temperature (or top_p when alone).cargo test -p codewhale-tui --lib body_drops_samplinggreen; clippy-D warningsclean (lib).Ported from the Pinvou/CodeWhale fork (#93, commit 3118c36); the Gemini and DeepSeek hunks of that fork commit are already covered upstream and are not included.
No-Issue: the heuristic Anthropic sampling gate missed Claude 5 / Haiku 5.5 on routes without exact catalog facts (port of fork PR #93)