Skip to content

feat: update reasoning for claude opus 4.7#2089

Open
hustxiayang wants to merge 4 commits into
envoyproxy:mainfrom
hustxiayang:add-display-and-claude-4.7
Open

feat: update reasoning for claude opus 4.7#2089
hustxiayang wants to merge 4 commits into
envoyproxy:mainfrom
hustxiayang:add-display-and-claude-4.7

Conversation

@hustxiayang
Copy link
Copy Markdown
Contributor

@hustxiayang hustxiayang commented Apr 27, 2026

Description

1 Previously, the display field defaulted to summarized and was dropped during translation. However, on Claude Opus 4.7 and Claude Mythos Preview, display defaults to omitted instead, so users must set display: "summarized" explicitly to receive summarized thinking [1]. This PR exposes the display parameter so users can control thinking content visibility.

2 Add opus-4-7 and mythos-preview to the list of effort-supported models. Also, with Claude Opus 4.7, Anthropic introduced xhigh as a separate effort tier between high and max for long-horizon agentic and coding tasks [2]; Upgrade anthropic-sdk-go from v1.27.1 to v1.38.0 for OutputConfigEffortXhigh constant support; Define self-owned ReasoningEffort constants (none, low, medium, high, xhigh, max) in the internal OpenAI schema package, replacing direct usage of openaisdk.ReasoningEffort* constants across Anthropic and Gemini translators. This decouples the gateway from the upstream OpenAI SDK's constant definitions and allows extending with values like max that are Anthropic-specific.

3 Add OfAdaptive branch to AWS Bedrock thinking map (previously missing).

4 4 outputConfigModels (structured outputs) is not updated for the new models as it is not available on AWS Bedrock for both Converse API and InvokeModel API.

1: https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking#summarized-thinking
2: https://platform.claude.com/docs/en/build-with-claude/effort#effort-levels

@hustxiayang hustxiayang requested a review from a team as a code owner April 27, 2026 19:48
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Apr 27, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.44%. Comparing base (edef4c5) to head (07ccdf8).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2089      +/-   ##
==========================================
+ Coverage   84.42%   84.44%   +0.02%     
==========================================
  Files         134      134              
  Lines       19162    19175      +13     
==========================================
+ Hits        16177    16193      +16     
+ Misses       1998     1995       -3     
  Partials      987      987              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dosubot
Copy link
Copy Markdown

dosubot Bot commented Apr 27, 2026

Related Documentation

1 document(s) may need updating based on files changed in this PR:

Envoy's Space

vendor-specific-fields /ai-gateway/blob/main/site/docs/capabilities/llm-integrations/vendor-specific-fields.md — ⏳ Awaiting Merge

How did I do? Any feedback?  Join Discord

@hustxiayang hustxiayang force-pushed the add-display-and-claude-4.7 branch from 5f6e1ec to 46c30b0 Compare April 27, 2026 20:09
@hustxiayang
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the Anthropic SDK to version 1.38.0 and adds a Display field to thinking configurations in Anthropic, OpenAI, and AWS Bedrock schemas. It also introduces a local ReasoningEffort type alias and constants to decouple the implementation from the OpenAI SDK, while extending support for new Anthropic models like opus-4-7 and mythos-preview. Review feedback identifies discrepancies in docstrings regarding the none reasoning effort value and suggests using the local type alias consistently in struct definitions to complete the decoupling.

Comment thread internal/apischema/openai/openai.go Outdated
Comment thread internal/apischema/openai/openai.go Outdated
Comment thread internal/apischema/openai/openai.go Outdated
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Apr 27, 2026
@hustxiayang
Copy link
Copy Markdown
Contributor Author

@aabchoo @nacx Do you mind to take a look? Thanks a lot!

Copy link
Copy Markdown
Member

@nacx nacx left a comment

Choose a reason for hiding this comment

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

LGTM. Can you fix the conflicts and rebase to latest main?

Signed-off-by: yxia216 <yxia216@bloomberg.net>
Signed-off-by: yxia216 <yxia216@bloomberg.net>
@hustxiayang hustxiayang force-pushed the add-display-and-claude-4.7 branch from 7a8b82e to c9d1abe Compare May 28, 2026 14:47
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels May 28, 2026
@hustxiayang
Copy link
Copy Markdown
Contributor Author

/retest

@hustxiayang
Copy link
Copy Markdown
Contributor Author

@nacx Hi, I have rebased and fixed the conflicts. Could you please help to merge this pr? Thanks a lot!

@nacx nacx enabled auto-merge (squash) June 1, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants