mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #311] [MERGED] feat(conversation): add durable note tag for connected roleplays #4554
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#4554
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/311
Author: @cha1latte
Created: 4/29/2026
Status: ✅ Merged
Merged: 5/3/2026
Merged by: @SpicyMarinara
Base:
main← Head:feat/conversation-notes📝 Commits (3)
493b0a5feat(conversation): add durable note tag for connected roleplays059d74efix(notes): scope single-note delete to chat + add loading and error states908a65dfix(notes): add id tie-breaker to note ordering for deterministic pruning📊 Changes
10 files changed (+355 additions, -3 deletions)
View changed files
📝
packages/client/src/components/chat/ChatSettingsDrawer.tsx(+121 -1)📝
packages/client/src/hooks/use-chats.ts(+31 -0)📝
packages/server/src/db/migrate.ts(+11 -0)📝
packages/server/src/db/schema/chats.ts(+17 -0)📝
packages/server/src/db/seed-mari.ts(+2 -1)📝
packages/server/src/routes/chats.routes.ts(+18 -0)📝
packages/server/src/routes/generate.routes.ts(+59 -0)📝
packages/server/src/services/conversation/character-commands.ts(+17 -1)📝
packages/server/src/services/storage/chats.storage.ts(+69 -0)📝
packages/shared/src/types/chat.ts(+10 -0)📄 Description
Summary
Adds a new
<note>tag, sibling to the existing<influence>tag, that conversation-mode characters can emit. Where<influence>is one-shot (consumed on first read into the connected roleplay),<note>is durable — it persists into the connected roleplay's prompt every turn until the user clears it from the chat settings drawer.Why
The conversation→roleplay context flow only had
<influence>, which evaporates after a single read. When something important happens in a DM that the roleplay character should durably remember (a fact learned, a promise made, a name introduced), the only options were a single-shot influence (gone after one turn) or asking the user to manually edit the roleplay's summary field.<note>fills that gap with a near-mirror of<influence>minus the consumption flag.Greenlit by @SpicyMarinara in the
#🍝-marinara-engineDiscord post here. No GitHub issue was opened in advance — happy to file one retroactively if maintainers prefer.Architecture
conversation_notestable mirroringooc_influencesminus theconsumedcolumn. Created automatically by the existing idempotentrunMigrations()(also added tomigrate.ts).ConversationNoteinterface alongsideOocInfluence.NOTE_REincharacter-commands.ts, parallel toINFLUENCE_RE. Tag is stripped from the visible message via the existing.replace()chain.chats.createNote()with char-budget pruning.<conversation_notes>block built ingenerate.routes.ts, injected before the last user message in roleplay/game prompts. Same scene-chat bypass as<ooc_influences>. Not consumed — that's the behavioral difference.GET /chats/:id/notes,DELETE /chats/:id/notes/:noteId,DELETE /chats/:id/notes. Disconnect flow also deletes the chat's notes alongside influences.useChatNotes,useDeleteChatNote,useClearChatNotes— same shape as the memory hooks pair.ChatSettingsDrawer.tsx, only shown for roleplay/game chats with a connection. View list, per-note delete (× button), and clear-all (trash icon at the section header).seed-mari.tsso Professor Mari knows about the new tag, and the in-prompt connected-roleplay-instructions block teaches conversation characters when to use<note>vs<influence>.Known limitations
<influence>.Test plan
<note>tag → tag is stripped from the visible message<conversation_notes>block appears in the assembled prompt with the note as a bulleted line under the framing text<conversation_notes>section is absent from Peek Prompt (correct empty-list behavior)<influence>regression: emit one, generate next turn (referenced), generate the turn after (no longer referenced) — Peek Prompt confirms<ooc_influences>is consumeddeleteNotesForChat)<note>...</note>Screenshots
Empty state, dark mode:

Populated, dark mode:

Populated, light mode:

Mobile viewport (~400px), light mode:

Peek Prompt showing the

<conversation_notes>section:Summary by CodeRabbit
Release Notes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.