[GH-ISSUE #4718] [Feature]: Per-chat image style override for custom image agents (follow-up to #4682/#4686) #2590

Closed
opened 2026-10-21 05:50:52 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @kolacheee on GitHub (Aug 7, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4718

Originally assigned to: @SpicyMarinara on GitHub.

What problem does this solve?

Follow-up to #4682 / PR #4686 (per-chat image connection override + snapshot button for custom image agents), requested by the same user after using the shipped feature:

"This works great, i can change image connection and create a snapshot with no issues — thanks again. If you ever get back to this (what is here already is more than enough) do you think it'd be possible to change the image style too? Like the illustrator has. I tried to change it via the agent prompt but it isn't always consistent."

Today the chat-level Image Style select applies to custom-agent images — but it's chat-global: one style profile for the Illustrator and every custom image agent in that chat. There's no way to render one custom agent in a different style than the chat's default (e.g. a "polaroid snapshots" agent alongside a painterly Illustrator), and steering style through the agent's prompt template is unreliable, as the requester found.

Proposed solution

Extend the per-chat, per-agent map that #4686 introduced — the shape was designed for exactly this kind of growth:

  • ChatMetadata.customAgentImageSettings[agentType] gains styleProfileId?: string | null alongside the existing imageConnectionId.
  • The same custom-agent card in Chat Settings → Agents gains an Image Style select (reusing the Illustrator style select pattern, with Chat default as the empty option).
  • Resolution: when set, the per-agent styleProfileId wins over the chat-wide imageStyleProfileId for that agent's image_prompt results, then falls through the existing chain (chat-wide → connection's style profile → default). Both handler twins (main generate.routes.ts and the retry route) need the same read, mirroring how the connection override was wired.
  • A deleted style profile behaves like the chat-wide key does today: resolve-time fallback down the chain, no cleanup machinery needed. (Note: unlike *ConnectionId keys there is no auto-sweeper for style ids — a stale entry is inert and falls through, same as chatMeta.imageStyleProfileId already does.)

Scope: same shape and size as the merged #4686 connection override (map extension + one select + a read at the two style-resolution sites) — comfortably within the "keep it small-scale" guidance from the parent request.

Alternatives considered

  • Prompt-template styling (status quo): the requester tried it; models apply it inconsistently, and it can't leverage the style-profile system (positive/negative prompt fragments, provider-specific handling).
  • Duplicating agents per style: the exact copy-paste churn #4682 was filed to eliminate — reintroducing it for styles would be a regression of intent.
  • Per-agent global (not per-chat) style in agent settings: doesn't cover the "same agent, different style per chat" case, which is the point of the per-chat map.

Additional context

Requested by the original #4682 reporter after validating PR #4686 in real use ("what's here is more than enough" — this is optional polish, explicitly low-priority). Queued behind current priority work (#4703, #4707–#4709); assigning to track ownership.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @kolacheee on GitHub (Aug 7, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4718 Originally assigned to: @SpicyMarinara on GitHub. ## What problem does this solve? Follow-up to #4682 / PR #4686 (per-chat image connection override + snapshot button for custom image agents), requested by the same user after using the shipped feature: > "This works great, i can change image connection and create a snapshot with no issues — thanks again. If you ever get back to this (what is here already is more than enough) do you think it'd be possible to change the image **style** too? Like the illustrator has. I tried to change it via the agent prompt but it isn't always consistent." Today the chat-level **Image Style** select applies to custom-agent images — but it's **chat-global**: one style profile for the Illustrator *and* every custom image agent in that chat. There's no way to render one custom agent in a different style than the chat's default (e.g. a "polaroid snapshots" agent alongside a painterly Illustrator), and steering style through the agent's prompt template is unreliable, as the requester found. ## Proposed solution Extend the per-chat, per-agent map that #4686 introduced — the shape was designed for exactly this kind of growth: - `ChatMetadata.customAgentImageSettings[agentType]` gains `styleProfileId?: string | null` alongside the existing `imageConnectionId`. - The same custom-agent card in **Chat Settings → Agents** gains an **Image Style** select (reusing the Illustrator style select pattern, with **Chat default** as the empty option). - Resolution: when set, the per-agent `styleProfileId` wins over the chat-wide `imageStyleProfileId` for that agent's `image_prompt` results, then falls through the existing chain (chat-wide → connection's style profile → default). Both handler twins (main `generate.routes.ts` and the retry route) need the same read, mirroring how the connection override was wired. - A deleted style profile behaves like the chat-wide key does today: resolve-time fallback down the chain, no cleanup machinery needed. (Note: unlike `*ConnectionId` keys there is no auto-sweeper for style ids — a stale entry is inert and falls through, same as `chatMeta.imageStyleProfileId` already does.) Scope: same shape and size as the merged #4686 connection override (map extension + one select + a read at the two style-resolution sites) — comfortably within the "keep it small-scale" guidance from the parent request. ## Alternatives considered - **Prompt-template styling** (status quo): the requester tried it; models apply it inconsistently, and it can't leverage the style-profile system (positive/negative prompt fragments, provider-specific handling). - **Duplicating agents per style**: the exact copy-paste churn #4682 was filed to eliminate — reintroducing it for styles would be a regression of intent. - **Per-agent global (not per-chat) style in agent settings**: doesn't cover the "same agent, different style per chat" case, which is the point of the per-chat map. ## Additional context Requested by the original #4682 reporter after validating PR #4686 in real use ("what's here is more than enough" — this is optional polish, explicitly low-priority). Queued behind current priority work (#4703, #4707–#4709); assigning to track ownership. ## Template check - [ ] I DID NOT read this template and provide the requested details.
Author
Owner

@SpicyMarinara commented on GitHub (Aug 7, 2026):

SpicyMarinara/Codex is implementing this in draft PR #4736 on agent/assigned-issues-4718-4734.

<!-- gh-comment-id:5222377607 --> @SpicyMarinara commented on GitHub (Aug 7, 2026): SpicyMarinara/Codex is implementing this in draft PR #4736 on `agent/assigned-issues-4718-4734`.
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#2590
No description provided.