fix(claude): rebuild the Responses reasoning chain
A Responses caller that asked for reasoning summaries got an empty chain of thought back: every reasoning item carried a signature and no text, so replaying it produced a Claude thinking block with an empty thinking field. The cause was the beta list, not the translator. Cloaked requests always sent redact-thinking-2026-02-12, which makes Anthropic withhold the summary text even when thinking.display is summarized. Native Claude Code 2.1.220 treats the two as mutually exclusive: the beta is only appended while thinking summaries are off, and the request builder removes it again whenever a display value is attached. An isolated 2.1.220 profile with showThinkingSummaries enabled confirms it on the wire, still on cc_entrypoint=cli, sending display=summarized without the beta and receiving thinking text. A direct A/B against claude-opus-4-8 pins the effect down: with the beta the thinking text is empty for every display value, without it and with display=summarized the text comes back. The beta is now dropped whenever the request carries thinking.display, which is exactly the native rule. Two translation gaps kept the chain lossy on the way back. redacted_thinking blocks had no Responses representation at all and vanished, even though Anthropic requires them to be replayed verbatim; they now ride in encrypted_content behind a marker prefix and are restored as redacted_thinking blocks. Reasoning text was only read from summary[], so a caller whose SDK models the text in content[] lost it; content[] is now used as a fallback, and only as a fallback so a client that mirrors both arrays does not replay the text twice. An item whose encrypted_content is missing or belongs to another provider is still dropped rather than replayed, because Anthropic rejects a thinking block without a signature and there is nothing to synthesize.
S
sususu committed
9b1142399c2985788bd9be27497689f746aca6d1
Parent: 6f8f11a