mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7141] [MERGED] fix(agents): preserve Claude thinking and cap reasoning budgets #7496
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#7496
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7141
Author: @SpicyMarinara
Created: 10/5/2026
Status: ✅ Merged
Merged: 10/5/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/agent-params-review-7131📝 Commits (6)
2588189Merge remote-tracking branch 'origin/staging' into fix/agent-connection-params-713104a8385fix(agents): address #7131 review findingsc6d3e19Merge remote-tracking branch 'origin/staging' into fix/agent-connection-params-71314ddb906Merge remote-tracking branch 'origin/staging' into fix/agent-connection-params-71311717ba3Merge remote-tracking branch 'origin/staging' into fix/agent-params-review-71317711f0ffix(agents): reserve thinking within fallback context📊 Changes
12 files changed (+641 additions, -108 deletions)
View changed files
📝
CHANGELOG.md(+3 -0)📝
docs/prompts/generation-parameters.md(+4 -4)📝
packages/server/src/routes/generate/retry-agents-route.ts(+2 -1)📝
packages/server/src/services/agents/agent-executor.ts(+30 -11)📝
packages/server/src/services/generation/agent-generation-parameters.ts(+42 -20)📝
packages/server/src/services/generation/illustrator-background-generation.ts(+3 -0)📝
packages/server/src/services/generation/illustrator-manual-prompt-generation.ts(+7 -9)📝
packages/server/src/services/llm/base-provider.ts(+10 -2)📝
packages/server/src/services/llm/connection-fallback-provider.ts(+8 -2)📝
packages/server/src/services/llm/providers/anthropic.provider.ts(+56 -12)📝
packages/shared/src/constants/model-lists.ts(+2 -2)📝
scripts/regressions/agent-connection-parameters.regression.ts(+474 -45)📄 Description
Linked issue
Refs #7131. Follow-up to #7135, which merged before the review-fix commit
04a8385d2was included.Why this change
With reasoning enabled, Claude Opus 4/4.1 agent batches can exceed the model's output limit and receive a 400. Tool-using Claude agents also need to preserve the signed thinking returned by one round when sending the next round. These fixes restore both paths and finish the parameter-handling review fixes from #7135.
What changed
Validation
pnpm installand a freshpnpm checkpassed at7711f0fce7519c5903ea98d4bc6cee8f7613dc3dafter integrating staging and fixing the GitHub review finding.node scripts/run-regressions.mjs --filter scripts/regressions/agent-connection-parameters.regression.tspassed. It exercises real request bodies with a controlled upstream, including the Opus batch cap, thinking replay, Send switches and context headroom. The added large-primary/small-fallback case failed before the fix and passes afterward with the complete prompt intact; known and unknown context limits are covered.provider-compat.regression.tsalso passed.max_tokens=32000andbudget_tokens=1024, satisfying the strict budget-below-output requirement. Existing boundary regression coverage passes. GitHub CodeRabbit then identified the smaller-fallback context case; that finding is fixed in7711f0fce, and the incremental local CodeRabbit review completed with zero findings.Manual verification notes
Docs and release impact
Updated
docs/prompts/generation-parameters.mdand the Unreleased changelog. No version or storage-format changes. Translation follow-up: #7142 covers the documentation changed by both #7135 and this PR.UI evidence (if applicable)
No frontend changes in this follow-up.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.