mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #6659] [Issue]: Illustrator manual generation hard-caps maxTokens at 1,800 #3731
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#3731
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 @SpicyMarinara on GitHub (Sep 25, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6659
Originally assigned to: @SpicyMarinara on GitHub.
Summary
The Illustrator agent's manual image-generation path silently clamps configured maxTokens to 1,800. This causes longer image_prompt JSON responses to be truncated and fail parsing, even when higher agent, connection, and model limits are configured.
Expected behavior
The outgoing request should use the configured agent maxTokens, subject to the connection override and known-model limit, without an undocumented 1,800-token ceiling.
Actual behavior
The outgoing request always uses "max_tokens": 1800 for manual illustrations when configured limits exceed 1,800. Responses can be truncated mid-JSON object, causing the agent to fail with a parse error.
Steps to reproduce
Environment
Logs, screenshots, or video
Outgoing request reportedly contains "max_tokens": 1800. No attachments provided. The issue was reproduced across two providers and four models: two GLM-based models, one Qwen-based model, and Kimi K3.
Additional context
The affected code is packages/server/src/services/generation/illustrator-manual-prompt-generation.ts. resolveManualIllustratorMaxTokens() applies Math.min(MANUAL_ILLUSTRATION_MAX_TOKENS, configuredLimit, modelLimit), with MANUAL_ILLUSTRATION_MAX_TOKENS set to 1,800. The agent editor accepts larger values without showing that they are ignored. Locally changing the constant to 8,192 resolved truncation. Suggested fixes are to raise the constant or use it only as a fallback when no agent value is configured; alternatively, surface the effective cap in the agent editor. Illustrator agent version and support diagnostics were not provided.
Discord thread: Illustrator maxTokens silently clamped to 1,800 by hard-coded constant
Discord thread link: https://discord.com/channels/1417099416812392641/1553012369221746698
Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653)
Discord thread transcript (2 messages)
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@SpicyMarinara commented on GitHub (Sep 25, 2026):
Implementation owner: Codex working for @SpicyMarinara. I am addressing this Engine-owned request-parameter bug in a focused PR against staging, reusing the existing provider and generation-limit code and regression suites.