[PR #6609] [MERGED] fix: preserve manual Illustrator prompts and character download rendering #7251

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6609
Author: @SpicyMarinara
Created: 9/24/2026
Status: ✅ Merged
Merged: 9/24/2026
Merged by: @SpicyMarinara

Base: staging ← Head: codex/6597-6598-assigned-fixes


📝 Commits (6)

  • 355011c test: reproduce lost Illustrator prompts and translated download crashes
  • c336409 fix: retain custom illustration instructions and stabilize download labels
  • 8c083e1 test: cover repeated translation and selected custom prompt resolution
  • ba29e32 fix: preflight complete manual Illustrator requests against context limits
  • 8d2945e test: require the selected prompt boundary before its manual override
  • ca21682 Merge branch 'staging' into codex/6597-6598-assigned-fixes

📊 Changes

5 files changed (+207 additions, -95 deletions)

View changed files

📝 CHANGELOG.md (+3 -0)
➕ e2e/bot-browser-download.e2e.ts (+104 -0)
📝 packages/client/src/components/bot-browser/BotBrowserView.tsx (+11 -6)
📝 packages/server/src/services/generation/illustrator-manual-prompt-generation.ts (+23 -83)
📝 scripts/regressions/prompt.regression.ts (+66 -6)

📄 Description

Manual Illustrator requests discarded custom visual instructions if they followed a response-schema heading, shared a line with generation conditions, or appeared inside a schema example. Browser-translated character download labels could also crash the app when React replaced their adjacent loading icon.

This fixes both issues with existing paths and no new dependencies:

  • Preserve the resolved Illustrator prompt intact, then apply the host's manual-generation contract. Gallery and /illustrate share this writer; manual requests still return the existing image-plan schema and bypass automatic cadence. Reuse the shared token-budget estimator before initial and retry calls, respect the connection context limit (Engine default when unspecified), and reject oversized requests without truncating instructions.
  • Put the Import and Download as PNG labels in stable spans so translation cannot invalidate React's icon insertion point.

Closes #6597
Closes #6598

Validation completed:

  • Negative controls on the original production code: the custom prompt vanished from the captured provider request; both translated download actions produced the exact reported insertBefore crash.
  • pnpm check: passed, including localization, formatting, TypeScript, lint and production builds. One existing unrelated GameNarration hook warning remains.
  • pnpm regression:prompt: passed. Added cases cover chat-selected custom prompts, schema-first instructions, inline generation conditions, schema examples and instructions beyond the former 12,000-character cutoff. Macro escaping and the manual response contract remain covered. Oversized initial and retry requests are rejected before the respective provider call.
  • Focused pnpm smoke:ui: first and repeated imports and PNG downloads pass in desktop Chromium, mobile Chromium and mobile WebKit; dark and light themes covered. The existing destination/lorebook-choice browser regression also passed on desktop (its mobile cases are intentionally skipped).
  • Full Linux ARM64 container build and scripts/smoke-container.mjs: passed frontend/API, native bindings and persistence across restart on production-code commit ba29e3272. Later changes affect test proof only.
  • Local CodeRabbit completed twice: both minor test findings were fixed (reapply simulated translation before each attempt; require the selected-mode closing tag before comparing instruction order). The hosted review context-budget finding was also fixed and validated. No findings dismissed.

Browser screenshots: downloadable before/after proof. The self-contained HTML includes the original crash and desktop/mobile results.

Claim limits: browser translation is a reproduced cause of the exact reported crash, inferred from the screenshot rather than confirmed on the reporter's Android/Brave installation. The Termux sharp warning is separate. Prompt verification captures the real writer's provider request; it does not assert that every image model follows every custom instruction.

Manual verification:

  • Manually verify the reporter's exact custom prompt through Gallery and /illustrate with their image provider.
  • Manually verify the first character import and PNG download in Android Brave after restart.

Summary by CodeRabbit

  • Bug Fixes
    • Manual Gallery and /illustrate requests retain custom Illustrator prompts, including visual instructions alongside response schemas. Requests that exceed the connection’s context limit now report an error instead of silently cutting instructions.
    • Character-browser imports and PNG downloads no longer crash when browser translation changes button labels.
  • Tests
    • Added regression coverage for translated button labels and custom Illustrator prompt formats.

🔄 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/6609 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 9/24/2026 **Status:** ✅ Merged **Merged:** 9/24/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `codex/6597-6598-assigned-fixes` --- ### 📝 Commits (6) - [`355011c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/355011c85683e18663945e4f2ff42384eebe72bb) test: reproduce lost Illustrator prompts and translated download crashes - [`c336409`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c336409ff7a43e40a856c4d2b4eed57963413b34) fix: retain custom illustration instructions and stabilize download labels - [`8c083e1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8c083e13ee1459b3ca742d8647f2d632f0a7aa65) test: cover repeated translation and selected custom prompt resolution - [`ba29e32`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ba29e3272a04eb94279c63d419a3460020f39d5b) fix: preflight complete manual Illustrator requests against context limits - [`8d2945e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8d2945e3d3b4b783704dd6d201ef8c891487f364) test: require the selected prompt boundary before its manual override - [`ca21682`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ca216820afd7a43c3b927a3124346217388f81df) Merge branch 'staging' into codex/6597-6598-assigned-fixes ### 📊 Changes **5 files changed** (+207 additions, -95 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+3 -0) ➕ `e2e/bot-browser-download.e2e.ts` (+104 -0) 📝 `packages/client/src/components/bot-browser/BotBrowserView.tsx` (+11 -6) 📝 `packages/server/src/services/generation/illustrator-manual-prompt-generation.ts` (+23 -83) 📝 `scripts/regressions/prompt.regression.ts` (+66 -6) </details> ### 📄 Description Manual Illustrator requests discarded custom visual instructions if they followed a response-schema heading, shared a line with generation conditions, or appeared inside a schema example. Browser-translated character download labels could also crash the app when React replaced their adjacent loading icon. This fixes both issues with existing paths and no new dependencies: - Preserve the resolved Illustrator prompt intact, then apply the host's manual-generation contract. Gallery and `/illustrate` share this writer; manual requests still return the existing image-plan schema and bypass automatic cadence. Reuse the shared token-budget estimator before initial and retry calls, respect the connection context limit (Engine default when unspecified), and reject oversized requests without truncating instructions. - Put the Import and Download as PNG labels in stable spans so translation cannot invalidate React's icon insertion point. Closes #6597 Closes #6598 Validation completed: - Negative controls on the original production code: the custom prompt vanished from the captured provider request; both translated download actions produced the exact reported `insertBefore` crash. - `pnpm check`: passed, including localization, formatting, TypeScript, lint and production builds. One existing unrelated GameNarration hook warning remains. - `pnpm regression:prompt`: passed. Added cases cover chat-selected custom prompts, schema-first instructions, inline generation conditions, schema examples and instructions beyond the former 12,000-character cutoff. Macro escaping and the manual response contract remain covered. Oversized initial and retry requests are rejected before the respective provider call. - Focused `pnpm smoke:ui`: first and repeated imports and PNG downloads pass in desktop Chromium, mobile Chromium and mobile WebKit; dark and light themes covered. The existing destination/lorebook-choice browser regression also passed on desktop (its mobile cases are intentionally skipped). - Full Linux ARM64 container build and `scripts/smoke-container.mjs`: passed frontend/API, native bindings and persistence across restart on production-code commit ba29e3272. Later changes affect test proof only. - Local CodeRabbit completed twice: both minor test findings were fixed (reapply simulated translation before each attempt; require the selected-mode closing tag before comparing instruction order). The hosted review context-budget finding was also fixed and validated. No findings dismissed. Browser screenshots: [downloadable before/after proof](https://gist.github.com/SpicyMarinara/2fb4abb652dcdcc234f1adfde0f4b6a4). The self-contained HTML includes the original crash and desktop/mobile results. Claim limits: browser translation is a reproduced cause of the exact reported crash, inferred from the screenshot rather than confirmed on the reporter's Android/Brave installation. The Termux sharp warning is separate. Prompt verification captures the real writer's provider request; it does not assert that every image model follows every custom instruction. Manual verification: - [ ] Manually verify the reporter's exact custom prompt through Gallery and `/illustrate` with their image provider. - [ ] Manually verify the first character import and PNG download in Android Brave after restart. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Manual Gallery and `/illustrate` requests retain custom Illustrator prompts, including visual instructions alongside response schemas. Requests that exceed the connection’s context limit now report an error instead of silently cutting instructions. * Character-browser imports and PNG downloads no longer crash when browser translation changes button labels. * **Tests** * Added regression coverage for translated button labels and custom Illustrator prompt formats. <!-- 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:17:57 +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#7251
No description provided.