[GH-ISSUE #5938] Experience launch nests the whole setup config inside itself and caps the copy at 32k, failing on a field players never see #3284

Closed
opened 2026-10-21 06:01:40 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @kolacheee on GitHub (Sep 7, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5938

Originally assigned to: @SpicyMarinara on GitHub.

Found during Pixelforge 0.16.2 design work; filing the Engine-side half. Pixelforge will fix what it can package-side, but the mechanism below affects every installed Experience.

The double-nesting. When an Experience launches a game, NewGameExperienceChooser.tsx (~line 100) sends the package's returned config twice in one setupConfig:

setupConfig: {
  ...cfg,                    // spread at top level (Zod strips the unknown keys)
  gameExperienceId: selectedId,
  experienceConfig: cfg,     // and the SAME whole object nested
}

The nested copy exists so Zod doesn't strip unknown experience fields (the comment says so), but because experienceConfig: cfg comes after the spread, it also overwrites any experienceConfig key the package itself put in its config — which is why package readers in the wild probe two nesting depths (Pixelforge's _configWorldName checks both experienceConfig.worldName and experienceConfig.experienceConfig.worldName).

Where it bites. MAX_EXPERIENCE_CONFIG_CHARS = 32_000 (game.routes.ts:1715) measures the nested copy — which is the entire package config, including classic setup fields like setting that have no length cap of their own. Today's packages write ~1 KB there so it never fires. But the moment an Experience legitimately carries player prose (a long Setting), the launch 400s with a validation error naming experienceConfig — a field no player has ever seen or typed into. The cap's own comment ("Generous next to what a setup wizard actually collects") stops being true once Experiences consume the classic wizard's collected fields, which is the direction Pixelforge is headed.

Maintainer's note when this surfaced: the cap "doesn't need to be that small."

Two candidate Engine fixes (either resolves it; both are behavior changes for every installed Experience, so this issue exists to decide rather than to prescribe):

  1. Stop double-nesting — send the package payload once, under one key, and let the schema pass it through opaquely.
  2. Keep the shape but measure/raise the cap so nested classic-field prose can't fail a launch on an invisible field — or exclude the known classic fields from the nested measurement.

Pixelforge-side mitigation (shipping in its 0.16.2 regardless): keep its own nested payload to its own keys so it contributes as little as possible to the measured copy.

Originally created by @kolacheee on GitHub (Sep 7, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5938 Originally assigned to: @SpicyMarinara on GitHub. Found during Pixelforge 0.16.2 design work; filing the Engine-side half. Pixelforge will fix what it can package-side, but the mechanism below affects every installed Experience. **The double-nesting.** When an Experience launches a game, `NewGameExperienceChooser.tsx` (~line 100) sends the package's returned config twice in one `setupConfig`: ```ts setupConfig: { ...cfg, // spread at top level (Zod strips the unknown keys) gameExperienceId: selectedId, experienceConfig: cfg, // and the SAME whole object nested } ``` The nested copy exists so Zod doesn't strip unknown experience fields (the comment says so), but because `experienceConfig: cfg` comes after the spread, it also overwrites any `experienceConfig` key the package itself put in its config — which is why package readers in the wild probe **two nesting depths** (Pixelforge's `_configWorldName` checks both `experienceConfig.worldName` and `experienceConfig.experienceConfig.worldName`). **Where it bites.** `MAX_EXPERIENCE_CONFIG_CHARS = 32_000` (game.routes.ts:1715) measures the nested copy — which is the *entire* package config, including classic setup fields like `setting` that have no length cap of their own. Today's packages write ~1 KB there so it never fires. But the moment an Experience legitimately carries player prose (a long Setting), the launch 400s with a validation error naming `experienceConfig` — a field no player has ever seen or typed into. The cap's own comment ("Generous next to what a setup wizard actually collects") stops being true once Experiences consume the classic wizard's collected fields, which is the direction Pixelforge is headed. **Maintainer's note when this surfaced:** the cap "doesn't need to be that small." **Two candidate Engine fixes** (either resolves it; both are behavior changes for every installed Experience, so this issue exists to decide rather than to prescribe): 1. Stop double-nesting — send the package payload once, under one key, and let the schema pass it through opaquely. 2. Keep the shape but measure/raise the cap so nested classic-field prose can't fail a launch on an invisible field — or exclude the known classic fields from the nested measurement. Pixelforge-side mitigation (shipping in its 0.16.2 regardless): keep its own nested payload to its own keys so it contributes as little as possible to the measured copy.
bsakaguchi 2026-10-21 06:01:40 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Sep 8, 2026):

@SpicyMarinara (Codex) is handling this issue in the maintainer-requested Issue Sweep PR #5962. Existing implementation PRs, draft PRs and issue-linked branches were checked before starting. The fix will reuse existing code and include focused regression proof; this comment records ownership, not completion.

<!-- gh-comment-id:5585132134 --> @SpicyMarinara commented on GitHub (Sep 8, 2026): @SpicyMarinara (Codex) is handling this issue in the maintainer-requested Issue Sweep PR #5962. Existing implementation PRs, draft PRs and issue-linked branches were checked before starting. The fix will reuse existing code and include focused regression proof; this comment records ownership, not completion.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#3284
No description provided.