mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #1027] [MERGED] fix(image-gen): harden OpenRouter image response parsing #4893
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#4893
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/1027
Author: @etherious1804
Created: 5/20/2026
Status: ✅ Merged
Merged: 5/20/2026
Merged by: @cha1latte
Base:
staging← Head:fix/openrouter-image-response-parsing📝 Commits (1)
c787fc9fix(image-gen): harden OpenRouter image response parsing📊 Changes
1 file changed (+47 additions, -3 deletions)
View changed files
📝
packages/server/src/services/image/image-generation.ts(+47 -3)📄 Description
Linked issue
Closes #1026
Why this change
OpenRouter's image-generation endpoint surfaces several response shapes depending on the underlying provider and the model's `modalities` config, and Marinara's current parser only handles the chat-completions JSON envelope cleanly. Two real failure modes today:
This PR is the split-out half of #970 that the reviewer asked to move into its own change.
What changed
`packages/server/src/services/image/image-generation.ts`:
No behavior change for OpenRouter responses that were already producing images successfully — the new path only branches on the response shape.
Validation
What I ran locally (prose, for reviewer reference)
Manual verification a reviewer should still do (these are paths I could not easily fixture locally):
Docs and release impact
Purely a server-side parser hardening. No docs or release-metadata changes.
UI evidence (if applicable)
No UI surface touched.
Note on relationship to #970
#970 (Draw Things) was originally a single combined PR with these OpenRouter parsing improvements bundled in. Per the reviewer's call to split unrelated work, those OpenRouter changes have been pulled out into this PR; #970 now only contains Draw Things support.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.