mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #4026] [Issue]: In GM mode, many hardcoded max_tokens values are too low #2171
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#2171
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 @Aculeasis on GitHub (Jul 24, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4026
Originally assigned to: @SpicyMarinara on GitHub.
Summary
In GM mode, many requests use hardcoded
max_tokensvalues that can be too low. As a result, the LLM can consume the entire token budget without being able to return valid output.Expected behavior
max_tokensvalues are intentional for different request types, expose amax_tokenssetting for each request type in the GM creation wizard.Actual behavior
When generating a medium-size map (16places), the model consumed the entire token budget, the response was exactly 10000 tokens. Generation was truncated at location 3 out of 16, meaning a significantly larger budget is needed for this request type :)
Other request types also appear to have hardcoded
max_tokens(and possibly other hardcoded parameters), so they may fail the same way.Additionally:
Steps to reproduce
Environment
Logs, screenshots, or video
Request for "Hierarchical world map" generation, with hardcoded
max_tokens:Popup error:
I also have the full response, but it is just had a large, truncated JSON.
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 (Jul 24, 2026):
Hm, seems like the issue is only with Hierarchical Maps, the Game mode itself respects connection overwrites.
@Aculeasis commented on GitHub (Jul 24, 2026):
Well, I enabled and set max_token 16000, Temperature 0.9, Top P 0.95:
@SpicyMarinara commented on GitHub (Jul 24, 2026):
Triaged this. The Game mode itself does honor the connection's Max Output Tokens (as you noted) — the problem is isolated to the Hierarchical Maps capability, and that's the catch: the map-draft generation, its hardcoded
max_tokens, and the "could not create a valid map draft" error all live inside the vendored, pre-built capability bundle (packages/server/data/capability-packages/versions/hierarchical-maps/*/server.mjs), not in the Marinara-Engine source tree.Those
.mjsfiles are minified build artifacts downloaded/installed by the capability package manager; their source is in the separate capability-package repo. So this can't be fixed from the Marinara-Engine repo without hand-editing a minified bundle (which the next package update would overwrite).Where the fix belongs (capability package source):
max_tokens: 10000truncating a 16-place medium map), or expose a per-request token setting in the GM wizard.Flagging for whoever maintains the hierarchical-maps capability package. Happy to open a PR there if you point me at the source repo.
@Aculeasis commented on GitHub (Jul 24, 2026):
@SpicyMarinara Alright, this agent is part of https://github.com/Pasta-Devs/Marinara-Agents (https://github.com/Pasta-Devs/Marinara-Agents/tree/main/packages/hierarchical-maps).
Not quite, please take a look at my previous post. Different requests are using different hardcoded parameters.
@SpicyMarinara commented on GitHub (Jul 24, 2026):
Fixed in the capability package: Marinara-Agents PR #99 (hierarchical-maps 1.1.8), owned by @SpicyMarinara.
Root cause: the Engine only uses a connection's Max Output Tokens to cap the map-draft request (
min(request, override)), never to raise it — and the capability requested small hardcoded per-size budgets (medium 10k), which reasoning models burn on hidden thinking before finishing the JSON. That's why setting 16000 didn't help.The capability can't read the connection's Max Output Tokens (the host abstraction only exposes
chatComplete), so the fix raises the per-size request budgets (small 12k / medium 24k / large 40k). The Engine still caps to the connection's setting, so a higher value now actually takes effect while a lower one is respected. Map-draft errors are also now specific (empty / truncated-JSON with an actionable hint / structure mismatch) instead of the generic message.Note: the "You can build one later from Chat Settings" wrapper in the popup is Engine-side (game-creation flow), so that discoverability wording is out of scope for the capability PR.