mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #4741] [Issue]: Model catalog gaps #2605
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#2605
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 @xDanteMD on GitHub (Aug 8, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4741
Originally assigned to: @SpicyMarinara on GitHub.
Summary
While investigating inconsistent Professor Mari workspace behavior (alt greetings reported as generated but missing from the character card), I traced the issue to the model catalog's
maxOutputresolution chain. Several model families accessed via NanoGPT, OpenRouter, and the Custom (OAI-compatible) provider silently receive an 8192 maxOutput fallback — far below their actual capabilities. This causes silent data loss when generating complex multi-item outputs, because the workspace agent's truncation detection is bypassed when tool calls are present.Expected behavior
Models with known capabilities (Deepseek V3/V4, MiMo V2.5, GLM-5.1, etc.) should resolve to their actual
maxOutputlimits from the static model catalog, rather than falling back to a hardcoded 8192. When truncation occurs mid-tool-call, the workspace agent should detect it and warn the user.Actual behavior
The catalog gap
resolveMariMaxOutputTokens(workspace-agent.service.ts:851) andresolveConnectionMaxOutputTokens(agent-resolution.ts:174) resolve max output tokens from a static model catalog (MODEL_LISTSin model-lists.ts). Several categories of models are missing or broken:model-lists.ts:970):nanogpt: []— empty array. Every model accessed via NanoGPT gets 8192 regardless of actual capabilities.model-lists.ts:969):openrouter: OPENROUTER_MODELSwhereOPENROUTER_MODELS = []— same problem."deepseek"exists in theAPIProvidertype. ADEEPSEEK_MODELSarray exists atmodel-lists.ts:501but is defined but never imported or referenced anywhere — dead code. Deepseek users must use "Custom (OAI-Compatible)" or NanoGPT, where Deepseek models don't match any catalog entry.ZAI_MODELS(lines 534-552). The catalog includes GLM-5 and GLM-5.2 but not 5.1.The dynamically fetched model limits from
/modelsendpoints (viareadOpenAICompatibleModelLimitsat connections.routes.ts:1505) are returned to the UI model picker but never persisted to the connection record — theapi_connectionsDB schema (connections.ts) has nomaxOutputcolumn. OnlymaxTokensOverride(line 74) exists as a manual per-connection escape hatch.The silent failure chain
When a model with an incorrect 8192
maxOutputis used for complex generation (e.g., writing multiple alt greetings via tool calls), the output gets truncated mid-stream. The workspace agent's truncation detection at line 1964 is conditional onaction.commands.length === 0— it only warns when the model produced no tool calls. When tool calls are present (the common case for complex tasks), the truncation check is bypassed entirely:The truncated JSON gets repaired (brackets closed), the tool calls execute with incomplete data, and the user sees success — but the content is silently missing.
Reproduction scenario
This is a 50-50 scenario depending on variable token overhead (thinking tokens, tool call verbosity, JSON formatting). It's not a consistent failure — it's inconsistent because the 8192 budget is sometimes enough and sometimes not.
Steps to reproduce
Environment
Logs, screenshots, or video
(None available — the behavior is intermittent and depends on token overhead, likely less egregious on dense models; hardcoded caps requiring manual override make testing a catalog of popular MoEs somewhat inefficient)
Additional context
Prior art
This issue relates to several previously reported and fixed issues, but addresses a distinct root cause:
Why this matters for MoE users specifically
MoE models (Deepseek V3/V4, MiMo V2.5, GLM-5.x, Kimi K series) are disproportionately affected because:
Proposed resolution
Immediate fix (low risk): Add the major MoE model families to
MODEL_LISTSwith correctmaxOutputspecifications:https://api-docs.deepseek.com/quick_start/pricing (TL;DR deepseek-v4-flash, deepseek-v4-pro, 1M context, 384k max output).
https://docs.z.ai/guides/overview/pricing - GLM 5.1 missing entirely from Z.ai provider, as well as nano-gpt
https://mimo.mi.com/models/en-US/mimo-v2.5-pro
Xiaomi official docs included just for official specs, they're censored on the official API. Crof (NanoGPT or direct) doesn't have the extra safety filters (and Reddit says some on OpenRouter also play along)
https://platform.kimi.ai/docs/pricing/chat-k26 Missing from Moonshot and NanoGPT
https://platform.kimi.ai/docs/pricing/chat-k3 Missing from Moonshot and NanoGPT
Wire the existing
DEEPSEEK_MODELSdead code into the catalog, or add the models to the appropriate provider catalog.Structural fix (medium risk): Persist the dynamically fetched
maxOutputfrom/modelsendpoints into the connection record (new DB column or intodefaultParametersJSON), and have the resolution functions check this persisted value before falling back to the static catalog.Defensive fix (complementary): Extend the workspace agent's truncation detection to fire regardless of whether tool calls are present, so users are warned when output is cut short.
Alternatives considered
maxTokensOverride— requires every user to manually set this for every NanoGPT/OpenRouter connection. Hard to discover in context, not automatic.@SpicyMarinara commented on GitHub (Aug 8, 2026):
Claimed by @SpicyMarinara for the current assigned-issue sweep. Implementation and validation are tracked in draft PR #4747.