mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2306] [Issue]: 09-CHAT-RUNTIME-connected-chat-notes-influences disconnect leaves stale linked context #1142
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#1142
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 @Promansis on GitHub (Jun 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2306
Originally assigned to: @Promansis on GitHub.
Summary
09-CHAT-RUNTIME-connected-chat-notes-influences: refactor disconnects only the requested chat in a connected conversation/roleplay/game pair. The partner chat can keepconnectedChatId, plus durable notes or unconsumed influences can remain active and continue entering linked roleplay/game prompts.Expected behavior
Legacy behavior should be preserved: connected chats are bidirectionally linked, disconnect clears both sides of the link, and connected notes/influences associated with the disconnected chat are cleared so stale OOC context cannot keep steering later prompts.
Actual behavior
Refactor
chat_disconnectclearsconnectedChatIdonly on the requested chat. It does not clear the partner chat'sconnectedChatId, and it does not clear embeddednotesentries whosesourceChatIdortargetChatIdbelongs to the disconnected pair.Prompt/write/import behavior is otherwise mostly present:
<note>and<influence>tags are parsed, stored on the linked roleplay/game chat'snotesarray, injected as<conversation_notes>and<ooc_influences>, and one-shot influences are consumed after prompt assembly.Steps to reproduce
<note>or unconsumed<influence>from the conversation into the linked roleplay/game chat.Impact area
Environment
refactor; source tracker #2268 usedrefactor@37585ab9Logs, screenshots, or video
Static parity trace only. No runtime logs, screenshots, or video.
Proof:
ooc_influencesandconversation_notestables with source/target chat ids and consumed state:main:packages/server/src/db/schema/chats.ts:66.main:packages/server/src/services/storage/chats.storage.ts:940.main:packages/server/src/routes/chats.routes.ts:756.chat_connectlinks both chats, butchat_disconnectonly patches the requested chat toconnectedChatId: null:src-tauri/src/commands/storage/commands/chats.rs:218./api/invokedispatch has the same one-sided disconnect behavior:src-tauri/src/http_dispatch.rs:877.<note>/<influence>on the target roleplay/game chat notes array:src/engine/generation/connected-commands.ts:156andsrc/engine/generation/connected-commands.ts:716.src/engine/generation/prompt-assembly.ts:1902.src/engine/generation/start-generation.ts:2893.src/features/catalog/chats/hooks/use-chats.ts:1191andsrc/features/modes/shared/chat-ui/components/ChatSettingsDrawer.tsx:3824.notes, so the storage-shape difference itself is not the gap:src-tauri/src/commands/storage/profile/legacy.rs:945.Regression notes
Legacy behavior on
mainkept the connection lifecycle symmetric and cleared connected sidecar context on disconnect. Refactor moved connected notes/influences intochats.notes, which is an intentional shape change, but disconnect cleanup did not preserve the legacy lifecycle semantics.Additional context
Surface:
09-CHAT-RUNTIME-connected-chat-notes-influencesSource tracker: #2268
Acceptance criteria:
connectedChatIdon both chats.<conversation_notes>or<ooc_influences>cannot enter future roleplay/game prompts./api/invokechat_disconnecthave matching behavior.conversation_notesandooc_influencesimports continue landing on the target chatnotesarray, unconsumed influences inject once, and durable notes inject until explicitly cleared while the pair remains connected.Follow-ups found but not chased in Batch 15:
notesentries bysourceChatId.Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: