mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8952] [MERGED] feat(capability): tell Long-Term Memory when a chat is branched #8907
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#8907
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/8952
Author: @Promansis
Created: 11/7/2026
Status: ✅ Merged
Merged: 11/7/2026
Merged by: @Promansis
Base:
staging← Head:feature(capability)/ltm-chat-branched📝 Commits (1)
731e794feat(capability): tell Long-Term Memory when a chat is branched (#8951)📊 Changes
6 files changed (+107 additions, -3 deletions)
View changed files
📝
docs/development/optional-agent-packages.md(+11 -0)📝
packages/server/src/routes/chats.routes.ts(+3 -0)📝
packages/server/src/services/generation/long-term-memory-runtime.ts(+22 -0)📝
packages/shared/src/schemas/capability-package.schema.ts(+4 -1)📝
scripts/regressions/capability-package-lifecycle.regression.ts(+2 -2)📝
scripts/regressions/chat-branch-lineage.regression.ts(+65 -0)📄 Description
Linked issue
Closes #8951
Why this change
When a chat is branched, the Engine copies the parent's messages with their "hidden from the AI" flags. The Long-Term Memory package hides messages it has already turned into memories, so a branch made from inside a hidden stretch opens with every copied message hidden. LTM can only show the last few again once it is asked about that chat, and that first happens at the branch's first recall, after the Engine has already read the history. The branch opens with recent messages shown as hidden, and the first reply is written without them. Packages are told nothing about new chats, so LTM cannot fix this itself.
What changed
chatBranched?({ chatId, parentChatId })on the host-onlylong-term-memory:runtimeservice. A package without it is unaffected. No manifest field or permission.POST /:id/branchawaits it once, after messages, metadata and snapshots are copied and beforegetById(newChat.id).logger.warnand never fails the branch (newnotifyLongTermMemoryChatBranchedhelper, reusingwithLongTermMemoryRuntimeTimeout).supportedCapabilityApibumped to 1.817 and the two 1.816 pins incapability-package-lifecycle.regression.tsmoved with it.docs/development/optional-agent-packages.md.chat-branch-lineage.regression.tscovers: called once with the new and parent ids, with copied messages andbranchParentChatIdreadable inside the call; a throwing service and a never-resolving service still return the branch; a service without the method branches as before.chatBranchedlives in Marinara-Agents and is not part of this PR.Validation
pnpm checkpasses locallyCONTRIBUTING.mdCommands run locally on this head (all exit 0):
build:shared; thechat-branch-lineage,capability-package-lifecycleandcapability-runtime-host-servicesregressions;prettier --checkon the changed .ts files;tsc --noEmit -p packages/server/tsconfig.json; roottsc(check:e2e-types); serverlint;git diff --check. Not run locally: whole-repopnpm check, the full regression suite, localization checks and a local CodeRabbit review (CLI not installed). Hosted CI covers the rest.Manual verification notes
chatBranched: branch a chat from inside a hidden stretch and confirm the branch opens with its recent messages shown.chatBranched, and with one whosechatBranchedthrows or hangs (the branch returns after at most about 3 seconds).Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)No version bump and no
CHANGELOG.mdedit (release PRs only). The docs change is developer documentation underdocs/development/, not a user guide.UI evidence (if applicable)
None: no client changes.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.