mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
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#6622
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/5089
Author: @kolacheee
Created: 8/15/2026
Status: ✅ Merged
Merged: 8/15/2026
Merged by: @kolacheee
Base:
staging← Head:feat/5073-mari-chat-context📝 Commits (6)
cceee53feat(mari): server foundation for attached chat-history context (#5073)d6b1d8dfeat(mari): chat-history attach menu + picker + Context Viewer (#5073)ec51324fix(mari): address adversarial review of the #5073 chat-history client334d58aMerge remote-tracking branch 'origin/staging' into feat/5073-mari-chat-contextabb252cfix(mari): address CodeRabbit review of the #5073 chat-history context71c368ffix(mari): picker request-token + correct focus-trigger capture (#5073)📊 Changes
17 files changed (+1274 additions, -36 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
package.json(+1 -1)📝
packages/client/src/components/chat/HomeProfessorMariChat.tsx(+66 -35)➕
packages/client/src/components/chat/MariAttachButton.tsx(+123 -0)➕
packages/client/src/components/chat/MariChatHistoryPicker.tsx(+399 -0)➕
packages/client/src/components/chat/MariContextViewer.tsx(+109 -0)➕
packages/client/src/hooks/use-mari-workspace-context.ts(+71 -0)➕
packages/client/src/hooks/use-modal-focus-trap.ts(+57 -0)📝
packages/client/src/localization/locales/en.json(+32 -0)📝
packages/server/src/db/file-backed-store.ts(+4 -0)📝
packages/server/src/db/schema/index.ts(+1 -0)➕
packages/server/src/db/schema/mari-workspace-context.ts(+35 -0)📝
packages/server/src/routes/professor-mari-workspace.routes.ts(+39 -0)➕
packages/server/src/services/professor-mari/mari-workspace-context-prompt.ts(+85 -0)📝
packages/server/src/services/professor-mari/workspace-agent.service.ts(+19 -0)➕
packages/server/src/services/storage/mari-workspace-context.storage.ts(+124 -0)➕
scripts/regressions/mari-workspace-context.regression.ts(+108 -0)📄 Description
Linked issue
Closes #5073
Why this change
Professor Mari can give creative feedback and make changes (characters, lorebooks, presets), but she can't see the roleplay/chat you're actually playing, so the feedback isn't grounded in it. This lets you attach slices of your chat history to a Mari conversation as reference context she can read.
Design (agreed with the maintainer's issue + a chosen approach): a dedicated, persistent per-Mari-chat context store rather than riding the one-off file-attachment channel — so an attached chat stays in context regardless of message age and is managed through a Context Viewer (add / remove to free tokens), which is exactly what the issue asks for.
What changed
Server
mari_workspace_contexttable — chat-scoped items (kind,label,sourceChatId,contentJSON,tokenEstimate), registered inFILE_BACKED_TABLESand cascaded fromchatsso attached context can't outlive its Mari chat.listForChat/create/remove) with a per-item content size guard.contextKind:'injection'block (survives the history-window trimmer, unlike per-message attachments), self-bounds its total size, and frames the content as user-provided evidence, not instructions (a prompt-injection line inside an attached chat is not obeyed). Wired intobuildPromptMessages./professor-mari/workspace/context(privileged-gated).Client
{role, name, content, at}JSON. Blocks before the request when a selection exceeds the server size cap.use-mari-workspace-context); all new copy localized inen.json.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Automated (done):
pnpm checkpasses (TypeScript + ESLint + localization + build); the newmari-workspace-contextregression passes (storage CRUD, chat scoping, size guard, and the injected block's transcript-inlining, evidence guardrail, and size bounding). The client was adversarially reviewed and the findings fixed (a Context-Viewer focus bug, a picker stale-response race, a label-vs-clamped-selection mismatch, a long-name label cap, and a dead "View attached context" control).Still needs a manual pass in a running app (unchecked above on purpose):
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)CHANGELOG updated under Added. No
docs/changes. No version bump. New table registered inFILE_BACKED_TABLES+ cascade graph; no on-disk layout change to an existing table, so nostorage-format.json/STORAGE_VERSIONbump.Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.