mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2759] [Issue]: Image-gen prompt/output correctness nits — orientation ignored, MIME mislabel, negatives, wrong-face reference #1398
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#1398
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?
Originally created by @kolacheee on GitHub (Jun 21, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2759
Originally assigned to: @SpicyMarinara on GitHub.
Summary
A set of lower-impact image-generation prompt/output correctness issues.
Sub-bug 1: aspectRatio ignored (#59)
aspectRatio, but the in-chat illustration path always uses the fixedimageSettings.illustration.width/heightand never readsillData.aspectRatio(grep: read nowhere). A 'portrait' scene renders at the global landscape resolution.Sub-bug 2: Wrong-face reference (#54)
buildNameAliasesadds every >=4-char name token as a standalone alias; the prompt-text pass attaches that character's reference image whenever the alias word-boundary-matches anywhere in the entire assistant turn. A character named with a dictionary word (Rose, Hunter, Grace) whose word appears for unrelated reasons gets their face attached as a likeness reference. (Gated behind useAvatarReferences/includeCharacterAppearance.)Sub-bug 3: MIME mislabel (#22)
detectImageMimeTypereturns 'image/png' as an unconditional default, making the declared/content-type fallbacks dead code; on the OpenRouter raw-bytes path an AVIF/BMP image is saved/served as .png/image/png.Sub-bug 4: Negative tag dup/separator (#57)
Sub-bug 5: Prefix tag dup (#58)
Sub-bug 6: Gallery write path/atomicity (#20/#21)
saveImageToDiskdoesjoin(GALLERY_DIR, chatId)+writeFileSyncwith noassertInsideDirand no temp-file+rename. chatId is validated upstream (low traversal risk), but the function is unguarded and the gallery DB row can reference a truncated file on crash.Suggested Fix
illData.aspectRatioto pick width/height (or remove it from the manifest/schema to stop wasting tokens).detectImageMimeTypereturn null when no signature matches so fallbacks run, or prefer the response content-type.[...hardPrefix, ...positiveFragments]with a single shared seen-set.assertInsideDir(GALLERY_DIR, dir)and write to a temp file then renameSync.Verification checklist (all manual)
pnpm checkAffected files
packages/shared/src/features/agents/illustrator/manifest.tspackages/server/src/routes/generate/illustrator-references.tspackages/server/src/services/image/image-generation.tspackages/shared/src/utils/image-prompt-compiler.tsAudit provenance
Found by a multi-agent static audit of the TTS/voice + image-generation subsystems (Round 1 + round-2 gap sweep + completeness critic, each finding adversarially verified) against the merged
stagingtree. Severity: LOW.@SpicyMarinara commented on GitHub (Jun 21, 2026):
Addressed on PR #2747. Fixed Illustrator aspectRatio sizing, tightened character reference matching so prompt-text scans use full-name aliases, made generated-image MIME detection nullable with AVIF/BMP support and explicit fallbacks, made gallery image writes path-contained and atomic, and cleaned image prompt compiler negative/prefix dedupe behavior. Validation so far: git diff --check. Full pnpm checks are intentionally deferred until the issue sweep is complete.