Repository navigation
fix(magic-ai): omit temperature for Claude models that reject it - #728
Merged
Merged
Conversation
Claude Opus/Sonnet 4.7 and later, including the Claude 5 family, return a 400 when a request carries temperature, so content generation failed on every current Claude model. Claude 3.x, Haiku 4.x and Opus/Sonnet up to 4.6 still receive the configured temperature; any other Claude model omits it so the next release does not break generation again. Only the temperature is dropped: the 16000-token floor stays specific to the OpenAI reasoning models that need it.
2 of 6 tasks
Copilot started reviewing on behalf of
navneetkumar-pim-webkul
September 24, 2026 16:24
View session
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Support Bedrock-style versioned Claude IDs and add prefixed-ID regression coverage.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Updates Magic AI to omit temperature for newer Claude models while preserving token settings for compatible models.
Changes:
- Adds Claude model compatibility detection.
- Adds regression tests for temperature and token handling.
| File | Summary |
|---|---|
packages/Webkul/MagicAI/src/Services/LaravelAiAdapter.php |
Applies Claude-specific temperature handling. |
packages/Webkul/Admin/tests/Feature/MagicAi/ReasoningModelTemperatureTest.php |
Tests Claude temperature and token behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
A Bedrock id such as anthropic.claude-opus-4-6-v1:0 ends in a -vN:M suffix the allowlist did not accept, so a Claude 4.6 model on Bedrock lost its temperature. The suffix is now accepted after the optional snapshot date, and prefixed Bedrock and Vertex ids are covered on both sides of the cut-off.
navneetkumar-pim-webkul
added a commit
that referenced
this pull request
Sep 24, 2026
Six merged pull requests since v3.1.1 carried no changelog entry: the gallery unsaved badge and worker timeout handler (#713), the import filter re-render (#720), the worker timeout alarm (#722), the channel name on PostgreSQL (#725), the price input height (#726), and the export view events (#717, #718). The two fixes pending in #727 and #728 are included so the cut merges after them. The model recommendation entry described the cheap-tier ranking that #724 replaced with newest-per-family; it now describes the shipped behaviour. 3.1.2 is a patch release, so everything is filed under bug fixes and improvements; no feature section. Core::VERSION, package.json and the UPGRADE.md walkthrough move to 3.1.2 together, as they did for 3.1.1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Issue Reference
N/A — found internally.
Description
Claude Opus/Sonnet 4.7 and later, including the Claude 5 family, return a 400 when a request carries
temperature, so Magic AI content generation failed on every current Claude model.LaravelAiAdapter::rejectsSamplingParameters()matches Claude model ids (bare, or prefixed like Bedrock/Vertexanthropic.claude-…). Claude 3.x, Haiku 4.x and Opus/Sonnet up to 4.6 (dated snapshots included) still receive the configured temperature; any other Claude model omits it, so the next release does not break generation again.How To Test This?
claude-opus-4-7orclaude-sonnet-5and generate product content.temperature.vendor/bin/pest packages/Webkul/Admin/tests/Feature/MagicAi/ReasoningModelTemperatureTest.php: 7 of the new cases fail before the fix, all 17 pass after. The MagicAI and Admin MagicAi suites pass (491 tests).Screenshots
N/A — no UI change.
Checklist
vendor/bin/pestpasses locallyvendor/bin/pint --testreports no style issues3.x, the current release line (mastertargets the next major)Documentation