Skip to content

Support for opus 4.7+ and gpt 5.4+ models#54

Merged
ScriptSmith merged 8 commits into
mainfrom
claude-4-7-4-8-gpt-5-4-support
Jun 9, 2026
Merged

Support for opus 4.7+ and gpt 5.4+ models#54
ScriptSmith merged 8 commits into
mainfrom
claude-4-7-4-8-gpt-5-4-support

Conversation

@ScriptSmith

Copy link
Copy Markdown
Member

No description provided.

@greptile-apps

greptile-apps Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds support for Opus 4.7/4.8 and GPT-5.4+ models by introducing two new reasoning effort levels (xhigh, max), a TaskBudgetConfig for agentic loops, adaptive-thinking model tiers (adaptive, strict, mid_conversation_system), and a phase field on OutputMessage for GPT-5.4 conversation chaining.

  • New effort levels: XHigh and Max are added to both ReasoningEffort and ResponsesReasoningEffort. Non-supporting providers (Bedrock, Vertex, non-strict Anthropic) clamp them to High; only strict Anthropic models (Opus 4.7/4.8) pass xhigh/max through.
  • Model-tier system: Three new configurable lists (adaptive_thinking_models, strict_thinking_models, mid_conversation_system_models) gate per-model behaviors: adaptive thinking with effort-based output config, sampling-param suppression, and inline system messages.
  • Task budget: CreateResponsesPayload gains a task_budget field (Opus 4.7/4.8 only). apply_task_budget correctly skips it when thinking is explicitly disabled and synthesizes adaptive thinking when none was specified. The task-budgets-2026-03-13 beta header is included via the updated compute_beta_header.

Confidence Score: 5/5

Safe to merge — no blocking defects found in the changed paths.

All three issues raised in the prior review round have been resolved: top_p is now correctly suppressed whenever thinking is active or the model is strict; the None effort variants use unreachable!() in the effort-translation helpers; and apply_task_budget guards against forwarding a task budget when thinking is explicitly disabled. The new model-tier system is driven by configurable lists rather than hardcoded substrings, and the effort-clamping logic is clearly separated. Test coverage for the new behaviors is thorough.

No files require special attention.

Important Files Changed

Filename Overview
src/providers/anthropic/convert.rs Refactored reasoning-config conversion to use configurable model lists; added XHigh/Max effort support, mid-conversation system message routing, and effort clamping via clamp_effort. None effort arms are now unreachable!(). Well-covered by new unit tests.
src/providers/anthropic/mod.rs Three model lists added to the provider struct; apply_task_budget now correctly skips the budget when thinking is disabled; top_p is now suppressed alongside temperature for both strict models and all thinking-enabled models in both API paths.
src/providers/anthropic/types.rs Added AnthropicThinkingDisplay, XHigh/Max to AnthropicEffort, optional effort/task_budget fields to AnthropicOutputConfig, and AnthropicTaskBudget. Serialization attributes are correct.
src/api_types/responses.rs Added XHigh/Max to ResponsesReasoningEffort, TaskBudgetConfig/TaskBudgetType structs, phase field on OutputMessage, and OutputMessagePhase enum. Validation on task_budget.total >= 20000 is present. task_budget is correctly nulled in strip_provider_fields.
src/config/providers.rs Three new configurable model lists with sensible defaults; Opus 4.7/4.8 correctly excluded from interleaved_thinking_models per API requirements.
src/providers/bedrock/convert.rs New effort variants XHigh/Max correctly clamped to high for Bedrock (no native concept). phase: None added to response constructors.
src/providers/vertex/convert.rs New effort variants correctly clamped to Gemini's High equivalent. phase: None added to response constructors.
src/routing/resolver.rs Dynamic provider config now includes the three new model lists with their defaults — consistent with the static config path.
ui/src/components/ModelParametersPopover/ModelParametersPopover.tsx Added Extra High and Max options to the effort dropdown. Consistent with backend enum values.
ui/src/components/chat-types.ts Extended ReasoningEffort type union to include xhigh and max. Doc comment notes provider-level clamping for unsupported models.

Reviews (11): Last reviewed commit: "Fix mid-conversation system gating and m..." | Re-trigger Greptile

Comment thread src/providers/anthropic/convert.rs Outdated
@ScriptSmith

Copy link
Copy Markdown
Member Author

@greptile-apps

Comment thread src/providers/anthropic/mod.rs Outdated
@ScriptSmith

Copy link
Copy Markdown
Member Author

@greptile-apps

@ScriptSmith

Copy link
Copy Markdown
Member Author

@greptile-apps

@ScriptSmith

Copy link
Copy Markdown
Member Author

@greptile-apps

1 similar comment
@ScriptSmith

Copy link
Copy Markdown
Member Author

@greptile-apps

@ScriptSmith ScriptSmith force-pushed the claude-4-7-4-8-gpt-5-4-support branch from 3302fea to c5071b2 Compare June 9, 2026 10:13
@ScriptSmith ScriptSmith merged commit 40b7e4c into main Jun 9, 2026
20 checks passed
@ScriptSmith ScriptSmith deleted the claude-4-7-4-8-gpt-5-4-support branch June 9, 2026 10:13
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