Skip to content

Preserve thinking.display for adaptive-thinking Anthropic requests - #481

Merged
ekeith (evanmkeith) merged 1 commit into
mainfrom
gate-107-gateway-drops-thinkingdisplay-summarized-for-adaptive
Oct 7, 2026
Merged

ekeith (evanmkeith) merged 1 commit into
mainfrom
gate-107-gateway-drops-thinkingdisplay-summarized-for-adaptive

Conversation

@evanmkeith

@evanmkeith ekeith (evanmkeith) commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Context

On the adaptive-thinking path (Opus 4.7+, Opus 5, Sonnet 5), the Anthropic adapter rebuilds thinking with display: None, dropping a caller's display: "summarized". Sonnet 5 / Opus 5 default to omitted, so thinking comes back empty, including via Bedrock-Anthropic.

Description

  • Carry display from the original thinking (typed via Thinking) into the rebuilt object; error if the extras don't parse.
  • No change when display is absent or the request didn't come from Anthropic format.
  • Add round-trip tests for the Anthropic and Bedrock-Anthropic adapters.

Testing

  • cargo test -p lingua, fmt --check, clippy -D warnings: pass.
  • New tests fail with the fix reverted and pass with it.

Addresses Linear GATE-107

…ATE-107)

## Context

On the adaptive-thinking path (Opus 4.7+, Opus 5, Sonnet 5), the Anthropic adapter rebuilds `thinking` with `display: None`, dropping a caller's `display: "summarized"`. Sonnet 5 / Opus 5 default to `omitted`, so thinking comes back empty, including via Bedrock-Anthropic. Reported in Pylon 22861 / GATE-107.

## Description

- Carry `display` from the original `thinking` (typed via `Thinking`) into the rebuilt object; error if the extras don't parse.
- No change when `display` is absent or the request didn't come from Anthropic format.
- Add round-trip tests for the Anthropic and Bedrock-Anthropic adapters.

## Testing

- `cargo test -p lingua`, `fmt --check`, `clippy -D warnings`: pass.
- New tests fail with the fix reverted and pass with it.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-06T20:18:03.419413Z 0ad7e92 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@erin2722 Erin McNulty (erin2722) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@evanmkeith
ekeith (evanmkeith) merged commit 3aefd80 into main Oct 7, 2026
15 checks passed
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.

2 participants