[PR #3936] [MERGED] Fix Illustrator current background context #6168

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/3936
Author: @SpicyMarinara
Created: 7/22/2026
Status: ✅ Merged
Merged: 7/22/2026
Merged by: @SpicyMarinara

Base: staging ← Head: agent/illustrator-current-background


📝 Commits (2)

  • ab6f96f fix: send active background to Illustrator
  • 74eb77e Merge branch 'staging' into agent/illustrator-current-background

📊 Changes

6 files changed (+43 additions, -5 deletions)

View changed files

📝 packages/client/src/hooks/use-generate.ts (+10 -1)
📝 packages/server/src/routes/generate.routes.ts (+9 -2)
📝 packages/server/src/routes/generate/retry-agents-route.ts (+20 -2)
📝 packages/server/src/services/generation/illustrator-background-generation.ts (+1 -0)
📝 packages/shared/src/schemas/chat.schema.ts (+1 -0)
📝 packages/shared/src/types/chat.ts (+2 -0)

📄 Description

Linked issue

No linked issue was supplied for this report. A tracking issue should be opened and linked before merge.

Why this change

  • Illustrator could report Currently active background: none even while a Roleplay or Visual Novel background was visibly active.
  • The runtime relied only on saved chat metadata, which did not always represent the currently displayed default or a pending background update.
  • The dedicated second-stage background planner accepted a current background but its callers did not supply one.

What changed

  • Send the active chat surface background with normal generation and agent retry requests.
  • Preserve metadata fallback behavior for inactive chats and legacy callers.
  • Use the resolved background in Illustrator and Background agent context.
  • Require and forward the current background when building an Illustrator scene background prompt.

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

Automated checks run while preparing this PR:

  • pnpm check
  • pnpm regression:prompt
  • git diff --check

Manual verification notes

  • Live Illustrator generation was not run to avoid consuming provider credits.
  • Manually verify a normal Illustrator run and a failed-job retry with both a saved background and the default Roleplay background. Confirm the debug prompt names the active background instead of reporting none.

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 documentation or release metadata changes are expected for this internal context fix.

UI evidence (if applicable)

Not applicable; no rendered UI was changed.

Summary by CodeRabbit

  • New Features
    • Generation requests now preserve the chat’s currently displayed background.
    • Background context is retained when retrying agent responses.
    • Automatic scene background generation now respects the active or newly selected background.
    • Background state is normalized consistently when unavailable or cleared.

🔄 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/3936 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 7/22/2026 **Status:** ✅ Merged **Merged:** 7/22/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `agent/illustrator-current-background` --- ### 📝 Commits (2) - [`ab6f96f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ab6f96f37999a08efe93776e8f500b62d698a5b0) fix: send active background to Illustrator - [`74eb77e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/74eb77e4bde5c4f5e466aad5a740e5e4da43cfae) Merge branch 'staging' into agent/illustrator-current-background ### 📊 Changes **6 files changed** (+43 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/hooks/use-generate.ts` (+10 -1) 📝 `packages/server/src/routes/generate.routes.ts` (+9 -2) 📝 `packages/server/src/routes/generate/retry-agents-route.ts` (+20 -2) 📝 `packages/server/src/services/generation/illustrator-background-generation.ts` (+1 -0) 📝 `packages/shared/src/schemas/chat.schema.ts` (+1 -0) 📝 `packages/shared/src/types/chat.ts` (+2 -0) </details> ### 📄 Description ## Linked issue No linked issue was supplied for this report. A tracking issue should be opened and linked before merge. ## Why this change - Illustrator could report `Currently active background: none` even while a Roleplay or Visual Novel background was visibly active. - The runtime relied only on saved chat metadata, which did not always represent the currently displayed default or a pending background update. - The dedicated second-stage background planner accepted a current background but its callers did not supply one. ## What changed - Send the active chat surface background with normal generation and agent retry requests. - Preserve metadata fallback behavior for inactive chats and legacy callers. - Use the resolved background in Illustrator and Background agent context. - Require and forward the current background when building an Illustrator scene background prompt. ## 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` Automated checks run while preparing this PR: - `pnpm check` - `pnpm regression:prompt` - `git diff --check` ### Manual verification notes - Live Illustrator generation was not run to avoid consuming provider credits. - Manually verify a normal Illustrator run and a failed-job retry with both a saved background and the default Roleplay background. Confirm the debug prompt names the active background instead of reporting `none`. ## 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 documentation or release metadata changes are expected for this internal context fix. ## UI evidence (if applicable) Not applicable; no rendered UI was changed. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Generation requests now preserve the chat’s currently displayed background. - Background context is retained when retrying agent responses. - Automatic scene background generation now respects the active or newly selected background. - Background state is normalized consistently when unavailable or cleared. <!-- 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:07:44 +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#6168
No description provided.