[PR #4634] [CLOSED] fix(noodle): improve stage profile prompt and unwrap LLM arrays #6449

Closed
opened 2026-10-23 04:10:32 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4634
Author: @Gunterlie
Created: 8/5/2026
Status: ❌ Closed

Base: staging ← Head: fix/noodler-stage-profile-prompt


📝 Commits (2)

  • 4c41b01 fix(noodle): improve stage profile prompt and unwrap LLM arrays
  • 7faae61 fix(noodle): improve stage profile draft robustness

📊 Changes

1 file changed (+9 additions, -2 deletions)

View changed files

📝 packages/server/src/services/noodle/noodle-stage-profile-draft.service.ts (+9 -2)

📄 Description

Update the system prompt to tell LLMs to return a single JSON object (no arrays) and specify valid disclosureMode enum values. Also add a minimal array unwrap guard for when local models still wrap the object in brackets.

Skipped ZodError catch — the prompt fixes are more reliable.

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #

Why this change

What changed

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Summary by CodeRabbit

  • Bug Fixes
    • Improved stage-profile generation by requiring a single, consistently structured JSON response with documented expected keys.
    • Added support for LLM responses returned as either a JSON object or a single-item array.
    • Tightened disclosureMode handling to only allow supported exact values (while making it non-mandatory during validation).
    • Normalized user handles by removing a leading @ when present.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/4634 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 8/5/2026 **Status:** ❌ Closed **Base:** `staging` ← **Head:** `fix/noodler-stage-profile-prompt` --- ### 📝 Commits (2) - [`4c41b01`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4c41b0124628146da79929b0f99f6fce569cd669) fix(noodle): improve stage profile prompt and unwrap LLM arrays - [`7faae61`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7faae618747be07b1c2f65e6007316b301e55f25) fix(noodle): improve stage profile draft robustness ### 📊 Changes **1 file changed** (+9 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/services/noodle/noodle-stage-profile-draft.service.ts` (+9 -2) </details> ### 📄 Description Update the system prompt to tell LLMs to return a single JSON object (no arrays) and specify valid disclosureMode enum values. Also add a minimal array unwrap guard for when local models still wrap the object in brackets. Skipped ZodError catch — the prompt fixes are more reliable. > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue <!-- Every PR should reference a feature request or issue report. If there isn't one yet, open one first to gather opinions: --> <!-- https://github.com/Pasta-Devs/Marinara-Engine/issues/new/choose --> Closes # ## Why this change <!-- What user problem, bug, or goal does this solve? --> - ## What changed <!-- List the key changes in this PR --> - ## Validation <!-- Required: include commands run and/or manual checks performed --> - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes <!-- Describe exactly what you tested in a real browser/app, step by step. --> <!-- ⚠️ If an AI agent filled out or ticked these boxes for you, treat them --> <!-- as a TO-DO LIST, not as proof the work is done. Verify each item yourself --> <!-- before submitting. If you haven't verified it, untick the box. --> - ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) <!-- Add before/after screenshots or recordings for UI changes --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved stage-profile generation by requiring a single, consistently structured JSON response with documented expected keys. * Added support for LLM responses returned as either a JSON object or a single-item array. * Tightened `disclosureMode` handling to only allow supported exact values (while making it non-mandatory during validation). * Normalized user handles by removing a leading `@` when present. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:10:32 +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#6449
No description provided.