mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3831] [Issue]: Agent-default changes (prompt template, per-agent toggles) don't propagate to existing chats — chatMeta overrides pin forever #2067
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#2067
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 @GetBeholder on GitHub (Jul 19, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3831
Originally assigned to: @SpicyMarinara on GitHub.
Summary
When a user changes an agent's default (e.g. the Illustrator agent's default prompt template, or its default Attach-Card-Appearance / Send-Avatar-References toggles), new chats correctly pick up the new default, but existing chats continue to use the old value indefinitely. There is no UI affordance to inherit-from-default; the only workaround is opening every existing chat and manually re-selecting the current default.
Confirmed by inspection:
chatMetais authoritative once it holds any value for a given field, and it's written on the user's first interaction with that field (even implicit interaction, in some cases). After that, the "default" the user changes in agent settings applies only to future chats.Expected behavior
A change to an agent's default should be reflected in all chats that have not explicitly overridden that field. Concretely, one of:
Actual behavior
Pattern in the server code (Node/TS Engine):
packages/server/src/routes/generate/retry-agents-route.ts:3057-3063(mirror atgenerate.routes.ts:7872):```ts
const useAvatarRefs =
typeof chatMeta.illustratorUseAvatarReferences === "boolean"
? chatMeta.illustratorUseAvatarReferences
: illustratorAgent?.resolved.settings?.useAvatarReferences === true;
```
Once
chatMeta.illustratorUseAvatarReferencesis set (trueorfalse), the ternary always resolves tochatMeta, and the agent's default is never consulted again. Same shape forillustratorIncludeCharacterAppearanceandillustratorPromptConnectionId.For prompt template selection,
chatMeta.agentPromptTemplateIdsis aRecord<agentType, templateId>:packages/server/src/routes/generate/retry-agents-route.ts:1046:```ts
const agentPromptTemplateSelections = normalizeAgentPromptTemplateSelectionMap(chatMeta.agentPromptTemplateIds);
// … later …
selectedPromptTemplateId: agentPromptTemplateSelections[cfg.type as string] ?? null,
```
Client-side fallback at
packages/client/src/components/chat/ChatSettingsDrawer.tsx:3821also picks a stable string:```ts
selectedId={agentPromptTemplateSelections[agent.id] ?? getDefaultPromptTemplateIdForAgent(agent.id)}
```
Whichever template ID lands in
chatMeta.agentPromptTemplateIds[agentType]sticks. ChangingdefaultPromptTemplateIdon the agent afterward has no effect on that chat.Same-shape pattern is used across other per-chat agent overrides (Music DJ, Storyboard, Video, etc.).
Steps to reproduce
Suggested fix (pick one)
chatMeta.X === null(or missing) as "inherit from agent default." Add a small "Reset to agent default" affordance per field in the chat's agent settings that writesnull. Chats that don't have the field set at all keep working; users can opt back into inheritance any time.Options 1 and 3 are compatible; 2 stands alone as a maintenance action.
Test plan (leave boxes unchecked until a human verifies)
Impact
Users who tune agent defaults after building up a chat backlog have to manually walk every chat to apply the change. Scales poorly, easy to miss chats, invisible to the user which chats are stale.
Environment
stagingHEAD)@SpicyMarinara commented on GitHub (Jul 19, 2026):
Claimed by @SpicyMarinara in draft PR #3835 for this assigned issue sweep.
@SpicyMarinara commented on GitHub (Jul 19, 2026):
Addressed in #3835: agent prompt-template overrides and Illustrator prompt/reference settings now expose inherited versus chat-override state and can be reset to the current agent default; matching setup values remain inherited.