[GH-ISSUE #8246] [Issue]: [illustrate:] commands ignore the Illustrator's lorebook, summary and author-notes context sources #8175

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

Originally created by @ylli-selmani on GitHub (Oct 24, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8246

Originally assigned to: @ylli-selmani on GitHub.

Summary

Roleplay [illustrate: ...] commands and the Gallery's manual Illustration button write their image prompt without the activated lorebook entries, the chat summary, or the author's notes. They skip these even when the Illustrator agent's Context Sources have them switched on. Automatic Illustrator runs do include them.

Expected behavior

An [illustrate: ...] command needs the Illustrator agent in the chat and uses its prompt and style, so it should also follow that agent's Context Sources. With "Activated lorebook entries", "Chat summary" and "Author notes" on, the prompt writer should see the same lorebook, summary and notes blocks an automatic Illustrator run gets.

Actual behavior

The command doesn't go through the normal agent prompt builder. generate.routes.ts sends illustrate to writeManualIllustratorPromptPlan, whose buildManualIllustratorPromptMessages builds its own system prompt. That prompt only holds the selected template, the style and caption rules, character and persona cards, tracker state and recent chat. The context it receives already carries activatedLorebookEntries, chatSummary and authorNotes, but none of them are read.

As a result, lore-dependent details (places, outfits, factions, items described only in lorebook entries) are missing from illustrations the narrator asks for. The prompt-writer call's input token count stays low even in a lorebook-heavy chat.

Steps to reproduce

  1. In a Roleplay chat, add the Illustrator agent and turn on Commands → Illustrations.
  2. Attach a lorebook with an entry that is keyword-triggered by the current scene.
  3. Let the narrator emit an [illustrate: ...] command (or press the Gallery's Illustration button).
  4. With agent debug logging on, read [debug/illustrator/manual-illustration-prompt] messages: there is no <activated_lorebook_context>, <chat_summary> or <author_notes> block. An automatic Illustrator run on the same turn has them.

Environment

  • Marinara Engine version: 2.5.1 (staging at fedb93770)
  • Install type: source
  • OS + version: Windows 11
  • Browser or app shell: n/a (server-side prompt assembly)

Logs, screenshots, or video

Provider usage for the two kinds of call shows the prompt writer's input staying low in a chat with active lorebook entries.

Additional context

  • Follows #7752, which made the command respect the Illustrator's reference-image toggle. This is the same idea for its context sources.
  • Proposed fix: move the source-gated reference blocks (activated lorebook entries, chat summary, author notes) out of buildAgentExtras into one shared helper. Normal agents and the manual Illustrator prompt writer then render them the same way, gated by the Illustrator's own Context Sources. Recalled memories stay out: for the built-in Illustrator that source needs the Vectors ability, which it doesn't have.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @ylli-selmani on GitHub (Oct 24, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8246 Originally assigned to: @ylli-selmani on GitHub. ## Summary Roleplay `[illustrate: ...]` commands and the Gallery's manual Illustration button write their image prompt without the activated lorebook entries, the chat summary, or the author's notes. They skip these even when the Illustrator agent's Context Sources have them switched on. Automatic Illustrator runs do include them. ## Expected behavior An `[illustrate: ...]` command needs the Illustrator agent in the chat and uses its prompt and style, so it should also follow that agent's Context Sources. With "Activated lorebook entries", "Chat summary" and "Author notes" on, the prompt writer should see the same lorebook, summary and notes blocks an automatic Illustrator run gets. ## Actual behavior The command doesn't go through the normal agent prompt builder. `generate.routes.ts` sends `illustrate` to `writeManualIllustratorPromptPlan`, whose `buildManualIllustratorPromptMessages` builds its own system prompt. That prompt only holds the selected template, the style and caption rules, character and persona cards, tracker state and recent chat. The context it receives already carries `activatedLorebookEntries`, `chatSummary` and `authorNotes`, but none of them are read. As a result, lore-dependent details (places, outfits, factions, items described only in lorebook entries) are missing from illustrations the narrator asks for. The prompt-writer call's input token count stays low even in a lorebook-heavy chat. ## Steps to reproduce 1. In a Roleplay chat, add the Illustrator agent and turn on Commands → Illustrations. 2. Attach a lorebook with an entry that is keyword-triggered by the current scene. 3. Let the narrator emit an `[illustrate: ...]` command (or press the Gallery's Illustration button). 4. With agent debug logging on, read `[debug/illustrator/manual-illustration-prompt] messages`: there is no `<activated_lorebook_context>`, `<chat_summary>` or `<author_notes>` block. An automatic Illustrator run on the same turn has them. ## Environment - Marinara Engine version: 2.5.1 (`staging` at `fedb93770`) - Install type: source - OS + version: Windows 11 - Browser or app shell: n/a (server-side prompt assembly) ## Logs, screenshots, or video Provider usage for the two kinds of call shows the prompt writer's input staying low in a chat with active lorebook entries. ## Additional context - Follows #7752, which made the command respect the Illustrator's reference-image toggle. This is the same idea for its context sources. - Proposed fix: move the source-gated reference blocks (activated lorebook entries, chat summary, author notes) out of `buildAgentExtras` into one shared helper. Normal agents and the manual Illustrator prompt writer then render them the same way, gated by the Illustrator's own Context Sources. Recalled memories stay out: for the built-in Illustrator that source needs the Vectors ability, which it doesn't have. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-11-07 16:42:13 +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#8175
No description provided.