mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #409] [Issue]: [v1.5.7] OpenRouter Claude returns 400 on non-initial generations when reasoning effort #171
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#171
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @cha1latte on GitHub (May 4, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/409
Originally assigned to: @SpicyMarinara on GitHub.
Summary
After upgrading to v1.5.7 (commit
84498fd), Claude Opus 4.6 via OpenRouter returnsOpenAI API error 400: Provider returned erroron any non-initial generation when reasoningeffortis set tolow,medium,high, ormaximum. Initial messages and regenerations of existing messages succeed.effort: noneworks at any verbosity. Worked correctly in v1.5.4.Environment
84498fd)anthropic/claude-opus-4.6Steps to Reproduce
anthropic/claude-opus-4.6.efforttolow(or higher).400: Provider returned error.effort: none→ ✅ all generations work (no thinking).Expected Behavior
Non-initial generations should succeed with reasoning enabled, matching v1.5.4 behavior.
Actual Behavior
No further detail in server or client console.
Root Cause Analysis
The v1.5.7 changelog notes:
Per OpenRouter's reasoning-tokens documentation:
This explains every observed symptom:
The likely location is
packages/server/src/services/llm/providers/openai.provider.ts. The provider is sendingreasoning: { effort }at the request level but not capturingreasoning_detailsfrom each assistant response and re-attaching them to historical assistant messages on subsequent turns.Suggested Fix
reasoning_detailsarray from each assistant message and persist it alongside chat history.messages[]for a follow-up request, include the capturedreasoning_detailson each assistant message verbatim — same order, no modification.effortis set and the provider is OpenRouter for a Claude/OpenAI reasoning model).Workaround
Set
effort: noneuntil fix is released. Generation works, just without thinking.Regression Marker
Last known-good version: v1.5.4 (thinking with OpenRouter Opus generated successfully on follow-up turns).
Want me to also draft the PR description if/when there's a fix branch, or is the issue enough?
</html> </html>Here's a GitHub issue ready to paste:Title:
[v1.5.7] OpenRouter Claude returns 400 on non-initial generations when reasoning effort ≥ lowSummary
After upgrading to v1.5.7 (commit
84498fd), Claude Opus 4.6 via OpenRouter returnsOpenAI API error 400: Provider returned erroron any non-initial generation when reasoningeffortis set tolow,medium,high, ormaximum. Initial messages and regenerations of existing messages succeed.effort: noneworks at any verbosity. Worked correctly in v1.5.4.Environment
84498fd)anthropic/claude-opus-4.6Steps to Reproduce
anthropic/claude-opus-4.6.efforttolow(or higher).400: Provider returned error.effort: none→ ✅ all generations work (no thinking).Expected Behavior
Non-initial generations should succeed with reasoning enabled, matching v1.5.4 behavior.
Actual Behavior
No further detail in server or client console.
Root Cause Analysis
The v1.5.7 changelog notes:
Per [OpenRouter's reasoning-tokens documentation](https://openrouter.ai/docs/guides/best-practices/reasoning-tokens):
This explains every observed symptom:
messages[]— noreasoning_detailsto preserve.reasoning_detailsin payload.reasoning_details.effort: noneworksverbositydoesn't matterThe likely location is
packages/server/src/services/llm/providers/openai.provider.ts. The provider is sendingreasoning: { effort }at the request level but not capturingreasoning_detailsfrom each assistant response and re-attaching them to historical assistant messages on subsequent turns.Suggested Fix
reasoning_detailsarray from each assistant message and persist it alongside chat history.messages[]for a follow-up request, include the capturedreasoning_detailson each assistant message verbatim — same order, no modification.effortis set and the provider is OpenRouter for a Claude/OpenAI reasoning model).Workaround
Set
effort: noneuntil fix is released. Generation works, just without thinking.Regression Marker
Last known-good version: v1.5.4 (thinking with OpenRouter Opus generated successfully on follow-up turns).
@AlbatrossAscot commented on GitHub (May 4, 2026):
Something lost in the LLM telephone: retrying a generation that was produced before the latest changes in 1.5.7 will work, even with thinking enabled, and it will think properly. That is, I can regenerate messages in RPs from yesterday with thinking enabled.
A generation from after the latest 1.5.7 changes, like one generated just now through the workaround of disabling thinking, will not regenerate with thinking enabled. It will produce the same 400.
@Pinkmoth419 commented on GitHub (May 4, 2026):
Also having this issue, haven't found a workaround yet but will share if I do 🫶🏻
@SpicyMarinara commented on GitHub (May 5, 2026):
Fix push soon.