fix(models): request visible thinking summaries on adaptive-thinking models - #308
Merged
Merged
Conversation
…models Models of the Sonnet 5 generation onward default the thinking `display` setting to "omitted": the API returns thinking blocks whose text is empty while the full thinking tokens are still billed. Any consumer relying on make_thinking_settings() therefore silently loses all visible reasoning in reports and logs on the newest models. Set display: "summarized" explicitly in the adaptive branch. Billing is identical for both display modes, so this only restores visibility. Verified end-to-end against Vertex claude-sonnet-5 (empty before, 3k chars of summarized thinking after). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
C# mirroring PR: askui/csharp-sdk#18 — should land in step (same parity rule as #302 ↔ csharp-sdk#16). |
mlikasam-askui
approved these changes
Aug 13, 2026
mlikasam-askui
approved these changes
Aug 13, 2026
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
Models of the Sonnet 5 generation onward default the thinking
displaysetting to "omitted": the API returns thinking blocks whose text is empty (signature only), while the full thinking tokens are still billed (usage.output_tokens_details.thinking_tokens). Every consumer ofmake_thinking_settings()therefore silently loses all visible reasoning in reports and logs on the newest models — bitten in production by the TCPos test-automation project, where HTML reports showed 175/175 empty thinking blocks.Older adaptive models (Sonnet 4.6 / Opus 4.6) default
displayto summarized, which is why the gap only appears from Sonnet 5 onward.What
make_thinking_settings()now returnsthinking={"type": "adaptive", "display": "summarized"}for adaptive models. Billing is identical for both display modes (docs) — this only restores visibility. The legacybudget_tokensbranch is unchanged.Verification
pytest tests/unit/models/test_thinking.py— 54 passed (assertions updated)ruff check/ruff format --checkclean on changed filesclaude-sonnet-5(rawPredict, eu + global endpoints): empty thinking text before, 3,162 chars of summarized thinking after — with identicalthinking_tokensbilledNotes
Same follow-up as #302: the C# SDK carries a port of this module — mirroring PR opened in askui/csharp-sdk.
🤖 Generated with Claude Code