mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #1646] [MERGED] Generate the illustration on the Gallery Illustrate retry path #5177
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#5177
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1646
Author: @Romuromylus
Created: 5/30/2026
Status: ✅ Merged
Merged: 5/30/2026
Merged by: @Romuromylus
Base:
refactor← Head:fix/illustrate-on-retry📝 Commits (3)
0ad84a0Generate the illustration on the Gallery Illustrate retry path2c17098Format illustrate-on-retry files to repository Prettier stylea5f2e90Drop redundant chat refresh and cover the no-options illustrate path📊 Changes
3 files changed (+227 additions, -18 deletions)
View changed files
📝
src/engine/generation/start-generation.test.ts(+170 -3)📝
src/engine/generation/start-generation.ts(+39 -14)📝
src/features/runtime/generation/hooks/use-generate.ts(+18 -1)📄 Description
Why this change
The Gallery "Illustrate" button routes through
retryAgents → retryGenerationAgents → runGenerationAgentsForTarget, which ran the illustrator agent and persisted itsimage_promptresult but never calledgenerateIllustrationAttachments. Only the normalstartGenerationpath did. So a successful illustrator prompt on the retry path was a silent no-op: the agent run was recorded, but no image was generated, no gallery row was written, no attachment was added, and no error surfaced.What changed
start-generation.ts:runGenerationAgentsForTargetnow runs the existinggenerateIllustrationAttachmentshelper when the target message has an illustrator prompt, appends its attachments via the existingappendSavedMessageAttachments, and surfaces itsillustration/illustration_errorevents.runGenerationAgentsForTargetandretryGenerationAgentsreturn{ results, events }instead ofAgentResult[]; the internal lorebook-keeper-backfill caller reads.results.RetryAgentsInputgainsimagePromptSettings.use-generate.ts: theretryAgentsconsumer destructures{ results, events }, threadsimagePromptSettings(matching thestartGenerationcall site), and handles theillustration/illustration_errorevents identically to the streaming switch (toast +["gallery","images",chatId]invalidation).Callers of the changed return shape, all updated:
use-generate.ts(production), the internalrunLorebookKeeperBackfill, and the existingretryGenerationAgentstest assertions.Verification
pnpm exec tsc -bclean;pnpm check:architectureclean (events flow out as plainGenerationEventdata; no React/Tauri import added to engine).illustration; a missing connection emitsillustration_error; a non-illustrator retry returns results with no events.start-generation.test.ts(56 tests) and the fullsrc/engine/generationsuite (192 tests) green.Manual
The user-visible Gallery Illustrate flow runs through real
invoke()(image-gen provider + gallery storage), so apnpm tauri devpass is the UI-level confirmation. The Illustrate button passes noAbortSignalon this path, so a slow provider can't be cancelled mid-illustration (pre-existing retry behavior, not changed here).Linked issue
Closes #1514.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.