[PR #8247] [MERGED] fix(illustrator): give [illustrate:] prompts the Illustrator's lorebook, summary and notes #8204

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8247
Author: @ylli-selmani
Created: 10/24/2026
Status: ✅ Merged
Merged: 10/24/2026
Merged by: @ylli-selmani

Base: staging ← Head: fix/illustrate-command-lorebook


📝 Commits (2)

  • e59e006 fix(illustrator): give [illustrate:] prompts the Illustrator's lorebook, summary and notes
  • 26ee5b5 refactor(illustrator): reuse the executor's default context sources

📊 Changes

3 files changed (+108 additions, -24 deletions)

View changed files

📝 packages/server/src/services/agents/agent-executor.ts (+40 -22)
📝 packages/server/src/services/generation/illustrator-manual-prompt-generation.ts (+15 -2)
📝 scripts/regressions/prompt.regression.ts (+53 -0)

📄 Description

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 #8246

Why this change

  • When the narrator writes [illustrate: ...], the image prompt is written without the chat's activated lorebook entries, chat summary or author notes. Lore-only details (places, outfits, factions, items) never reach the picture. You can tell from the provider's usage list: the prompt writer's input tokens stay low even in a lorebook-heavy chat.
  • The command, like the Gallery's Illustration button, doesn't go through the normal agent prompt builder. Its manual prompt writer built its own system prompt and never read those fields, even though they were already in its context.
  • The command needs the Illustrator agent in the chat and uses its prompt and style, and #7752 made it follow the Illustrator's reference-image toggle. So it should follow the Illustrator's Context Sources too.

What changed

  • One shared builder for the reference blocks. Activated lorebook entries, chat summary and author notes move out of buildAgentExtras into the exported buildAgentReferenceContextBlock(context, sources) (agent-executor.ts). buildAgentExtras calls it at the same spot, so every normal agent prompt is byte-identical to before.
  • The manual Illustrator writer uses it. buildManualIllustratorPromptMessages adds the same block after the character/persona context, gated by the Illustrator agent's own Context Sources (getAgentContextSources). This covers [illustrate:] commands and the Gallery Illustration button.
  • Recalled memories stay out. For the built-in Illustrator that source needs the Vectors ability, so its toggle is unavailable.
  • Regression (prompt.regression.ts): with default sources, the writer gets all three blocks, identical to the shared helper's output. With lorebook and summary toggled off, only author notes remain.

Not changed: the manual writer's existing character, persona, tracker and history blocks still ignore their toggles. Gating them would change current Gallery-button behaviour, so it is left for a separate decision.

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

  • Local runs so far: pnpm check exit 0. Regressions: prompt 7/7, agent-connection-parameters 1/1, illustrator-character-prompts 1/1, agent-runtime 2/2. Removing the new wiring makes the new assertions fail.
  • Manually verify in the browser: in a Roleplay chat with the Illustrator added, Commands → Illustrations on, and a lorebook entry that triggers on the current scene, let the narrator emit [illustrate: ...]. With agent debug logging on, the [debug/illustrator/manual-illustration-prompt] messages log contains <activated_lorebook_context> with that entry, and the provider shows higher input tokens for the call.
  • Manually verify that switching off "Activated lorebook entries" in the Illustrator's Context Sources removes the block from the next [illustrate:] call.
  • Manually verify the Gallery's Illustration button also carries the lorebook block.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) 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)

No UI change. Server-side prompt assembly only.

🤖 Generated with Claude Code


🔄 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/8247 **Author:** [@ylli-selmani](https://github.com/ylli-selmani) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@ylli-selmani](https://github.com/ylli-selmani) **Base:** `staging` ← **Head:** `fix/illustrate-command-lorebook` --- ### 📝 Commits (2) - [`e59e006`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e59e0068c892e4b9fafeddadb0765f0a4df75b89) fix(illustrator): give [illustrate:] prompts the Illustrator's lorebook, summary and notes - [`26ee5b5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/26ee5b5f0cc4ac50de0d6b84c4bc225fb3249ea1) refactor(illustrator): reuse the executor's default context sources ### 📊 Changes **3 files changed** (+108 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/services/agents/agent-executor.ts` (+40 -22) 📝 `packages/server/src/services/generation/illustrator-manual-prompt-generation.ts` (+15 -2) 📝 `scripts/regressions/prompt.regression.ts` (+53 -0) </details> ### 📄 Description > [!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 Closes #8246 ## Why this change - When the narrator writes `[illustrate: ...]`, the image prompt is written without the chat's activated lorebook entries, chat summary or author notes. Lore-only details (places, outfits, factions, items) never reach the picture. You can tell from the provider's usage list: the prompt writer's input tokens stay low even in a lorebook-heavy chat. - The command, like the Gallery's Illustration button, doesn't go through the normal agent prompt builder. Its manual prompt writer built its own system prompt and never read those fields, even though they were already in its context. - The command needs the Illustrator agent in the chat and uses its prompt and style, and #7752 made it follow the Illustrator's reference-image toggle. So it should follow the Illustrator's Context Sources too. ## What changed - **One shared builder for the reference blocks.** Activated lorebook entries, chat summary and author notes move out of `buildAgentExtras` into the exported `buildAgentReferenceContextBlock(context, sources)` (`agent-executor.ts`). `buildAgentExtras` calls it at the same spot, so every normal agent prompt is byte-identical to before. - **The manual Illustrator writer uses it.** `buildManualIllustratorPromptMessages` adds the same block after the character/persona context, gated by the Illustrator agent's own Context Sources (`getAgentContextSources`). This covers `[illustrate:]` commands and the Gallery Illustration button. - Recalled memories stay out. For the built-in Illustrator that source needs the Vectors ability, so its toggle is unavailable. - Regression (`prompt.regression.ts`): with default sources, the writer gets all three blocks, identical to the shared helper's output. With lorebook and summary toggled off, only author notes remain. Not changed: the manual writer's existing character, persona, tracker and history blocks still ignore their toggles. Gating them would change current Gallery-button behaviour, so it is left for a separate decision. ## 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 - Local runs so far: `pnpm check` exit 0. Regressions: `prompt` 7/7, `agent-connection-parameters` 1/1, `illustrator-character-prompts` 1/1, `agent-runtime` 2/2. Removing the new wiring makes the new assertions fail. - Manually verify in the browser: in a Roleplay chat with the Illustrator added, Commands → Illustrations on, and a lorebook entry that triggers on the current scene, let the narrator emit `[illustrate: ...]`. With agent debug logging on, the `[debug/illustrator/manual-illustration-prompt] messages` log contains `<activated_lorebook_context>` with that entry, and the provider shows higher input tokens for the call. - Manually verify that switching off "Activated lorebook entries" in the Illustrator's Context Sources removes the block from the next `[illustrate:]` call. - Manually verify the Gallery's Illustration button also carries the lorebook block. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) 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) No UI change. Server-side prompt assembly only. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi changed title from [PR #8247] fix(illustrator): give [illustrate:] prompts the Illustrator's lorebook, summary and notes to [PR #8247] [MERGED] fix(illustrator): give [illustrate:] prompts the Illustrator's lorebook, summary and notes 2026-11-07 16:45: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#8204
No description provided.