mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3773] [Issue]: Sidecar scene analysis rejects long narration instead of applying its context budget #2036
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#2036
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 @Xelvanis on GitHub (Jul 18, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3773
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Sidecar scene analysis rejects narration over 16,000 characters before inference, while connection-based scene analysis accepts up to 50,000 characters. The smaller sidecar budget appears appropriate for local inference, but it is enforced as an abrupt request failure rather than an explicit compaction policy, and the client plus both server routes maintain separate versions of the same base request contract.
Expected behavior
Long narration should be handled consistently and deliberately for the selected analyzer:
This is not a request to raise the sidecar limit to 50,000 characters.
Actual behavior
POST /api/sidecar/analyze-scenevalidates narration withz.string().max(16000). An oversized turn is rejected before the sidecar's existing context-fitting logic runs. The client then applies inline GM tags and displays the generic “Scene analysis failed” retry/skip UI.POST /api/game/scene-wrapaccepts the same narration up to 50,000 characters. It also differs from the sidecar route in required/default context fields and player-action limits. The client declares a third handwritten TypeScript request shape.Steps to reproduce
/api/sidecar/analyze-sceneis rejected by request validation and the UI falls back to inline tags with a scene-analysis failure message./api/game/scene-wrapaccepts the request schema.Environment
staging2.3.3 atde19d54e4bbb1c3555f89dbfae40999aa4f45712Logs, screenshots, or video
No runtime logs or screenshots. The failure is deterministically established by the route schemas and client error path.
Additional context
The 16,000-character limit is plausibly intentional rather than arbitrary:
packages/shared/src/types/sidecar.ts.packages/server/src/services/sidecar/sidecar-inference.service.ts.Relevant contracts:
packages/client/src/hooks/use-scene-analysis.ts— handwritten client request typepackages/server/src/routes/sidecar.routes.ts— 16,000-character sidecar validationpackages/server/src/routes/game.routes.ts— 50,000-character connection validationA narrow fix would share the base request/context schema and introduce one explicit narration-normalization function or policy. Endpoint-specific budgets can remain different, but should be named and tested as intentional behavior rather than drifting inline literals.
Duplicate search: no matching open or closed issue, or open pull request, was found for “scene analysis sidecar narration”, “16000”, “16k”, or “context budget”.
Template check
@SpicyMarinara commented on GitHub (Jul 18, 2026):
Addressed in #3775. The PR is ready for review, all required CI checks are green, and CodeRabbit feedback has been applied.