[GH-ISSUE #4626] [Issue]: Noodler stage profile creation fails with ZodError when LLM returns array-wrapped or invalid enum responses #2526

Closed
opened 2026-10-21 05:49:33 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @MetzeVanDeus on GitHub (Aug 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4626

Originally assigned to: @Gunterlie on GitHub.

Summary

Noodler stage profile creation fails with ZodError when local LLM models return array-wrapped JSON or invalid disclosureMode enum values.

Expected behavior

Stage profile draft is created successfully and stored in the Noodler schedule.

Actual behavior

Creation fails with:

  • Expected object, received array — LLM returns [{...}] instead of {...}
  • Invalid enum value. Expected 'open' | 'hinted' | 'secret', received '...' — LLM returns a description sentence instead of the enum value

Steps to reproduce

  1. Open the launcher and navigate to Noodle settings → Manage Noodler schedules
  2. Click "Run now" on a scheduled profile that triggers stage draft creation
  3. If the LLM returns an array-wrapped response or invalid disclosureMode, the creation fails with a ZodError

Environment

  • Marinara Engine version: 2.4.2 staging
  • Install type: source (Windows)
  • OS + version: Windows 11
  • Browser or app shell: App shell (launcher)

Logs, screenshots, or video

LLM output:

[
{
  "displayName": "Taro",
  "handle": "@Taro_One",
  "bio": "...",
  "stagePersonality": "...",
  "disclosureMode": "hinted"
}
]

LLM output (invalid disclosureMode):

  "disclosureMode": "Always"

Server log:

ZodError: Expected object, received array

Or:

ZodError: Invalid enum value. Expected 'open' | 'hinted' | 'secret', received 'Always'

Additional context

  • Same pattern as #4597 (noodler post creation) — PR #4604 fixed that one
  • This fix adds a prompt update to specify "single JSON object only" and valid enum values.
  • Draft fix

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @MetzeVanDeus on GitHub (Aug 5, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4626 Originally assigned to: @Gunterlie on GitHub. ## Summary Noodler stage profile creation fails with ZodError when local LLM models return array-wrapped JSON or invalid `disclosureMode` enum values. ## Expected behavior Stage profile draft is created successfully and stored in the Noodler schedule. ## Actual behavior Creation fails with: - `Expected object, received array` — LLM returns `[{...}]` instead of `{...}` - `Invalid enum value. Expected 'open' | 'hinted' | 'secret', received '...'` — LLM returns a description sentence instead of the enum value ## Steps to reproduce 1. Open the launcher and navigate to Noodle settings → Manage Noodler schedules 2. Click "Run now" on a scheduled profile that triggers stage draft creation 3. If the LLM returns an array-wrapped response or invalid `disclosureMode`, the creation fails with a ZodError ## Environment - Marinara Engine version: 2.4.2 staging - Install type: source (Windows) - OS + version: Windows 11 - Browser or app shell: App shell (launcher) ## Logs, screenshots, or video LLM output: ``` [ { "displayName": "Taro", "handle": "@Taro_One", "bio": "...", "stagePersonality": "...", "disclosureMode": "hinted" } ] ``` LLM output (invalid disclosureMode): ``` "disclosureMode": "Always" ``` Server log: ``` ZodError: Expected object, received array ``` Or: ``` ZodError: Invalid enum value. Expected 'open' | 'hinted' | 'secret', received 'Always' ``` ## Additional context - Same pattern as #4597 (noodler post creation) — PR #4604 fixed that one - This fix adds a prompt update to specify "single JSON object only" and valid enum values. - [Draft fix](https://github.com/Pasta-Devs/Marinara-Engine/compare/staging...MetzeVanDeus:Marinara-Engine:fix/noodler-stage-profile-prompt) ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:49:33 +07:00
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#2526
No description provided.