feat(anthropic): stream thinking summaries, fix haiku thinking budget, dynamic-filtering web search#297
Merged
Merged
Conversation
…, dynamic-filtering web search - ThinkingLevelMapper sets display="summarized" so adaptive-thinking summaries stream; the API default "omitted" returns empty thinking blocks on Opus 4.8 / Sonnet 5 / 4.7. - claude-haiku-4-5 THINKING_BUDGET floor -1 -> 1024: haiku has no dynamic thinking mode, and the -1 -> "auto" translation raised ConstraintViolationError against the numeric Range. - Select web_search_20260209 (dynamic filtering) for models that support it, basic web_search_20250305 otherwise; the supported-model list lives in the anthropic catalog.
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
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.
What
Three Anthropic text improvements:
Stream thinking summaries.
ThinkingLevelMappernow emitsthinking: {type: "adaptive", display: "summarized"}. On Opus 4.8 / Sonnet 5 / Opus 4.7 the API defaultsdisplayto"omitted", which streams thinking blocks with empty text (nothinking_deltaevents) — so adaptive-thinking summaries never surfaced to callers that stream reasoning.Fix haiku thinking budget.
claude-haiku-4-5THINKING_BUDGETfloor-1 → 1024. Haiku 4.5 has no dynamic/adaptive thinking mode (only a fixedbudget_tokens, min 1024); the-1 → "auto"translation was then re-validated against the numericRangeand raisedConstraintViolationError: "Must be numeric, got str"at request build.Dynamic-filtering web search. Select
web_search_20260209(dynamic filtering) for models that support it (Opus 4.6+ / Sonnet 4.6+ / Fable 5), basicweb_search_20250305otherwise. The supported-model list lives in the Anthropic text catalog (DYNAMIC_FILTERING_MODELS); a plain conditional in the textToolsMapperpicks the version. No model IDs in the mapper, nothing added to core.Verification
ruff+mypy(344 files) clean; unit tests pass.web_search_20260209streams interleaved reasoning with populated grounding on supporting models (note: dynamic filtering runs search inside code execution, so inlineweb_search_result_locationcitations are not emitted on those turns — an API behavior, not a regression here).🤖 Generated with Claude Code