Repository navigation
fix(claude): honor thinking.display "summarized" by not adding redact-thinking beta - #17003
Closed
huynle-dev wants to merge 3 commits into
Closed
huynle-dev wants to merge 3 commits into
huynle-dev wants to merge 3 commits into
Conversation
…"summarized" OmniRoute adds the redact-thinking-2026-02-12 beta for opaque clients and for clients that negotiate interleaved-thinking (selectBetaFlags), and the static API-key beta set carries it too. With that beta Anthropic returns thinking blocks with empty text (signature only), silently overriding an explicit thinking.display: "summarized" from clients such as @ai-sdk/anthropic / OpenCode. - selectBetaFlags omits redact-thinking when the body asks for summarized thinking (or OMNIROUTE_REDACT_THINKING=false). - A final dispatch pass strips OmniRoute-added redact-thinking-* tokens from anthropic-beta under the same rule (covers the static API-key set). - Client-negotiated redact-thinking and CC-compatible connections with requestDefaults.redactThinking=true keep it.
…aiku 4.5 Pins the /v1/messages body handleChatCore sends for claude (OAuth) and anthropic (API key): adaptive + display summarized passes through unchanged on haiku/sonnet/opus 5.5, Haiku 4.5 keeps enabled + budget, and a manual budget on Haiku 5.5 collapses to adaptive (regression cover for cheaper-inference#15841).
diegosouzapw
added a commit
that referenced
this pull request
Oct 18, 2026
…ed display (carries #17003) (#17040) Carries #17003 by @huynle-dev (org-owned fork rejects maintainer pushes). Summarized thinking is no longer redacted for non-OAuth claude requests; the Claude OAuth fingerprint stays unchanged unless CLAUDE_OAUTH_SUMMARIZED_THINKING_UNREDACTED (default off) is enabled. Focused tests 95/95; typecheck, open-sse typecheck, boundary 774/774, env-doc-sync, changelog-integrity, docs-counts green. Remaining CI reds are the inherited base-red #15306. Thanks @huynle-dev for finding the root cause of #16407! Co-authored-by: Huy Le <dacrazyazn@gmail.com>
Collaborator
|
Thank you @huynle-dev — this landed as #17040. Your branch is in an organization-owned fork, where GitHub does not let maintainers push even with "allow edits by maintainers" on (403), so your three commits were carried into #17040 unchanged and you are credited with a |
This was referenced Oct 18, 2026
Merged
diegosouzapw
added a commit
that referenced
this pull request
Oct 19, 2026
Reconcile the living [3.8.52] CHANGELOG section against the full cycle (release/v3.8.51..0a1265e, 1,386 non-merge commits): fold the 74 pending changelog.d fragments, add bullets for the 53 commits that had none, patch PR links/credits on 50 bullets (closed-PR re-lands credited: #16988 ← #16982 @fabioKoruja00, #17040 ← #17003 @huynle-dev), regenerate the Contributors table (306 external), date the header (TBD → 2026-10-19) and resync the 66 i18n CHANGELOG mirrors.
7 tasks
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.
Summary
Claude requests that explicitly ask for readable thinking (
thinking: { type: "adaptive", display: "summarized" }, as sent by@ai-sdk/anthropic/ OpenCode) came back with empty thinking text plus a signature. Cause: OmniRoute adds theredact-thinking-2026-02-12beta by itself:selectBetaFlags()pushes it for opaque clients and for any client that negotiatedinterleaved-thinking-2025-05-14(which@ai-sdk/anthropicalways sends), andANTHROPIC_BETA_API_KEYset used by API-key connections includes it.Only CC-compatible relays without the
redactThinkingopt-in had it stripped (the post-pass inbase.ts).Fix (new pure leaf
open-sse/executors/base/redactThinkingBeta.ts):selectBetaFlags()leaves outredact-thinking-2026-02-12when the body asks forthinking.display: "summarized".stripInternalBodyFields) removes OmniRoute-addedredact-thinking-*tokens fromanthropic-betaunder the same rule, so the static API-key set is covered too.OMNIROUTE_REDACT_THINKING=falsestops OmniRoute adding the redact beta at all (documented in.env.example+docs/reference/ENVIRONMENT.md).requestDefaults.redactThinking: truekeeps it. Withoutdisplay: "summarized"(and without the env), current behavior stays the same.Related Issues
claude(OAuth) provider.Target Branch
release/v3.8.xbranch (release/v3.8.52), notmainValidation
tests/unit/claude-*.test.ts tests/unit/anthropic-*.test.ts tests/unit/executor-*.test.ts tests/unit/cc-compatible*.test.ts tests/unit/provider-request-failure-pipeline.test.ts tests/unit/context-editing-executor-injection.test.ts tests/unit/base-*.test.ts→ 2064 tests, 2056 pass, 1 fail (Adapta stream errors are sanitized in an isolated executor fixture, which fails the same way locally without this change).tsc -p tsconfig.typecheck-core.jsonclean; Prettier clean;check-file-sizeandcheck-env-doc-syncOK.npm run lint(CI)Tests Added Or Updated
tests/unit/claude-5x-thinking-passthrough.test.ts(new, test-only): end-to-endhandleChatCorecoverage that captures the upstream/v1/messagesbody.thinking: {type:"adaptive", display:"summarized"}must reach the upstream unchanged forclaude-haiku-5-5/claude-sonnet-5-5/claude-opus-5-5on bothclaude(OAuth) andanthropic(API key). Haiku 4.5 must keepenabled+budget_tokens. A manual budget on Haiku 5.5 must collapse to adaptive. This is regression cover for fix(claude): stop downgrading adaptive thinking on claude-haiku-5-5 #15841: without it, 3.8.51 rewrites Haiku 5.5 toenabled+budget_tokens: 10000, which the API-key path rejects with 400 and the OAuth path answers with empty thinking. Passes on the currentrelease/v3.8.52tip.tests/unit/claude-summarized-thinking-redact-beta.test.ts(new): predicate/env unit tests,selectBetaFlagswith and without summarized display, the header strip helper (incl. client and connection opt-in), and end-to-endDefaultExecutordispatch forclaude(OAuth) andanthropic(API key) capturing the outboundanthropic-beta.tests/unit/provider-request-failure-pipeline.test.ts(CC-compatible relay withredactThinking: true+summarizeThinking: truestill keeps the beta) passes unchanged.Coverage Notes
open-sse/executors/base/redactThinkingBeta.tsis fully exercised by the new test; thebase.ts/claudeIdentity.tscall sites are covered by the dispatch tests.Reviewer Notes
open-sse/executors/base.tsgrows by +5 lines (1744 → 1749, cap 2094): one import plus one call at the final dispatch chokepoint.redact-thinking-2026-02-12. That is the behavior the client asked for; setrequestDefaults.redactThinkingon a CC-compatible connection, or send the beta from the client, to keep redaction.