Skip to content

Preserve thinking.display field when streaming to display thinking for newer opus models#151

Open
durvia wants to merge 2 commits into
Xerxes-2:masterfrom
durvia:preserve-thinking-display
Open

Preserve thinking.display field when streaming to display thinking for newer opus models#151
durvia wants to merge 2 commits into
Xerxes-2:masterfrom
durvia:preserve-thinking-display

Conversation

@durvia
Copy link
Copy Markdown

@durvia durvia commented May 29, 2026

Add an optional display field to Adaptive variants of the Thinking enum so the value survives the deserialize -> serialize round trip.

Previously clewdr silently dropped {"display":"summarized"}, so newer models fell back to encrypted thinking on the /code/v1 surface.

The field uses #[serde(default, skip_serializing_if = "Option::is_none")] so clients sending a bare {"type":"adaptive"} are unaffected.

E2E tested.

durvia added 2 commits May 29, 2026 17:19
Add an optional display field to the Enabled and Adaptive variants of
the Thinking enum so the value survives the deserialize -> serialize
round trip. Previously clewdr silently dropped {"display":"summarized"},
so newer models fell back to encrypted thinking on the /code/v1 surface.

The field uses #[serde(default, skip_serializing_if = "Option::is_none")]
so clients sending a bare {"type":"adaptive"} are unaffected.
The display field only applies to adaptive thinking; the budget-based
enabled variant should not accept or emit it. Drop display from Enabled
and revert Thinking::new.
@durvia durvia marked this pull request as ready for review May 29, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant