[PR #615] [MERGED] Fix NovelAI V4 native prompt input #4696

Closed
opened 2026-10-22 04:09:54 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/615
Author: @cha1latte
Created: 5/9/2026
Status: ✅ Merged
Merged: 5/9/2026
Merged by: @cha1latte

Base: main ← Head: fix/issue-587-novelai-v4


📝 Commits (1)

  • 1ff658f Fix NovelAI V4 native prompt input

📊 Changes

2 files changed (+60 additions, -2 deletions)

View changed files

📝 packages/server/src/services/image/image-generation.ts (+1 -1)
📝 packages/server/test/image-generation-local.test.ts (+59 -1)

📄 Description

Linked issue

Closes #587

Why this change

  • Native NovelAI image generation sent V4/V4.5 requests with an empty top-level input, which can make NovelAI return a 500 even though V3 requests succeed.

What changed

  • Keep the merged prompt text in NovelAI's top-level input for V4/V4.5 requests while preserving the existing v4_prompt and v4_negative_prompt parameters.
  • Updated the focused native NovelAI regression test to assert the V4.5 payload keeps input.
  • Added V3 coverage to confirm non-V4 requests keep their existing prompt shape and do not receive V4-only fields.

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

  • Codex reproduced the original request-shape failure with node scratch\issue-587-novelai-v4-repro.mjs before the fix: the mock native NovelAI endpoint rejected the V4.5 request because input was "" and returned NovelAI image generation failed (500): {"statusCode":500,"message":"Internal Server Error"}.
  • Codex reran node scratch\issue-587-novelai-v4-repro.mjs after the fix: the same V4.5 flow succeeded with input: "cat cafe" and hasV4Prompt: true.
  • Codex ran pnpm --filter @marinara-engine/server exec tsx --test test/image-generation-local.test.ts; all 3 focused image-generation tests passed, including V4.5 payload metadata and V3 prompt-shape coverage.
  • Codex ran pnpm check; it passed.
  • Live NovelAI generation was not run because this environment does not have NovelAI credentials. The core request-shape claim is covered by the captured outbound payload tests.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

No docs or release metadata changes are needed for this backend request payload fix.

UI evidence (if applicable)

N/A. This is a backend/provider request-building fix with command-level before/after proof.


🔄 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/615 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/9/2026 **Status:** ✅ Merged **Merged:** 5/9/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `main` ← **Head:** `fix/issue-587-novelai-v4` --- ### 📝 Commits (1) - [`1ff658f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1ff658fe6dbeb74ef4d86ad1c9f9dda6f99ea0a8) Fix NovelAI V4 native prompt input ### 📊 Changes **2 files changed** (+60 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/services/image/image-generation.ts` (+1 -1) 📝 `packages/server/test/image-generation-local.test.ts` (+59 -1) </details> ### 📄 Description ## 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 #587 ## Why this change <!-- What user problem, bug, or goal does this solve? --> - Native NovelAI image generation sent V4/V4.5 requests with an empty top-level `input`, which can make NovelAI return a 500 even though V3 requests succeed. ## What changed <!-- List the key changes in this PR --> - Keep the merged prompt text in NovelAI's top-level `input` for V4/V4.5 requests while preserving the existing `v4_prompt` and `v4_negative_prompt` parameters. - Updated the focused native NovelAI regression test to assert the V4.5 payload keeps `input`. - Added V3 coverage to confirm non-V4 requests keep their existing prompt shape and do not receive V4-only fields. ## 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. --> - Codex reproduced the original request-shape failure with `node scratch\issue-587-novelai-v4-repro.mjs` before the fix: the mock native NovelAI endpoint rejected the V4.5 request because `input` was `""` and returned `NovelAI image generation failed (500): {"statusCode":500,"message":"Internal Server Error"}`. - Codex reran `node scratch\issue-587-novelai-v4-repro.mjs` after the fix: the same V4.5 flow succeeded with `input: "cat cafe"` and `hasV4Prompt: true`. - Codex ran `pnpm --filter @marinara-engine/server exec tsx --test test/image-generation-local.test.ts`; all 3 focused image-generation tests passed, including V4.5 payload metadata and V3 prompt-shape coverage. - Codex ran `pnpm check`; it passed. - Live NovelAI generation was not run because this environment does not have NovelAI credentials. The core request-shape claim is covered by the captured outbound payload tests. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) No docs or release metadata changes are needed for this backend request payload fix. ## UI evidence (if applicable) N/A. This is a backend/provider request-building fix with command-level before/after proof. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:09:54 +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#4696
No description provided.