[PR #1196] [MERGED] fix(long-term-memory): targeted group recall returns only the responder's memories #1341

Closed
opened 2026-10-21 05:09:13 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1196
Author: @Promansis
Created: 10/2/2026
Status: ✅ Merged
Merged: 10/2/2026
Merged by: @Promansis

Base: staging ← Head: fix(long-term-memory)/targeted-group-recall


📝 Commits (2)

  • 401f08b fix(long-term-memory): 1.3.39 — targeted group recall returns only the responder's memories (#1194)
  • 612b244 test(long-term-memory): cover targeted filtering after the group grows (#1194)

📊 Changes

14 files changed (+175 additions, -62 deletions)

View changed files

➕ artifacts/long-term-memory-1.3.39.zip (+0 -0)
📝 catalog/catalog.json (+6 -6)
📝 catalog/notes.json (+6 -6)
📝 catalog/v2/catalog.json (+6 -6)
📝 catalog/v2/notes.json (+6 -6)
📝 catalog/v3/catalog.json (+6 -6)
📝 catalog/v3/notes.json (+6 -6)
📝 packages/long-term-memory/CHANGELOG.md (+4 -0)
📝 packages/long-term-memory/manifest.json (+3 -3)
📝 packages/long-term-memory/server.mjs (+22 -22)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/generation-injection.ts (+13 -0)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/retrieval.ts (+10 -0)
📝 scripts/build-feature-packages.mjs (+1 -1)
📝 tests/long-term-memory-runtime.regression.ts (+86 -0)

📄 Description

Pull request

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #1194

Why this change

  • In a multi-character group chat the Engine targets one responder and passes that responder's id in promptCharacterIds, but Long-Term Memory ignored it and recalled every chat character's memories plus global, chat-only, persona-only, mixed-character, and foreign-character/shared-chat notes. A targeted responder could receive memories that belong to another character.

What changed

  • long-term-memory 1.3.39: prepareGenerationLongTermMemory treats a non-empty strict subset of a multi-character chat's characters as the targeted responder, and passes an explicit exclusiveCharacterIds signal into retrieval.
  • retrieveLongTermMemory applies the restriction only when that option is set: an eligible note must have non-empty scope.characterIds and every id must be in the target set. Global, chat-only, persona-only, mixed-character, and other characters' shared-chat notes are excluded; a non-targeted full-set handoff or a single-character chat keeps today's chat-wide behavior.
  • Added the #1194 runtime regression (target A and B isolation, shared-scope exclusions, full-set preservation, empty and unknown target fallback).
  • Rebuilt generated outputs: manifest.json, server.mjs, artifacts/long-term-memory-1.3.39.zip, catalog v2/v3 lanes and the legacy alias, and notes.json release notes; client.js unchanged.
  • npm run check (prettier/eslint) passes; other callers of matchesLtmScope/ltmScopesOverlap (GET /notes, transfer, extraction, reconciliation, subject-identity, /search) are unchanged because the new option is opt-in from generation only.

Package and security impact

  • Affected package IDs: long-term-memory
  • Engine compatibility impact: none; engine.min/maxExclusive unchanged (>=2.4.1 <4.0.0), capability API 1.6 unchanged. The Engine already supplies the target ids; no Engine change is required.
  • New or changed permissions/entrypoints: none (permissions and entrypoints unchanged).
  • Restart, storage, update, or uninstall impact: none; only generation recall filtering changed. Data-loss/trust boundary unchanged.

Validation

  • node scripts/validate-catalog.mjs passes locally
  • git diff --check passes locally
  • Rebuilt every affected manifest, payload, artifact, and catalog entry
  • Installed or updated the affected package through Marinara Engine
  • Checked supported modes, restart behavior, and uninstall cleanup
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Repository-required gates on the final commit, all exit 0: npm run check; node scripts/test-catalog-lanes.mjs; node scripts/validate-package-locales.mjs; node scripts/validate-catalog.mjs; node scripts/tests/catalog-release-notes.regression.mjs; git diff --check.
  • Long-Term Memory regressions on the final commit, all exit 0: runtime, scope-targets, routes, routes-notes, routes-scope-identity, storage, local-characters, installation.
  • The installation regression installs the exact committed long-term-memory-1.3.39.zip and covers install, offline restart, full-backup inclusion, uninstall, reinstall, and durable-byte preservation against the real Engine host runtime.
  • Artifact SHA-256: 4a1ee518310f58285effc2583f075ca2d742880ea230ac04fa656c793026d19e.
  • Hosted CI and live group-chat/browser validation have not been run yet; they remain pending for this commit. No checkbox above is claimed as performed by this PR author.

Documentation impact

  • No documentation changes needed
  • Updated this README catalog and package guidance
  • Updated linked Marinara Engine documentation

UI evidence (if applicable)

  • Not applicable: no client or UI change.

Summary by CodeRabbit

  • New Features
    • Long-Term Memory 1.3.39 now limits group-chat recall for a character-targeted response to memories scoped to that character. Memories scoped to other characters, the chat generally, or a persona are not included in that targeted recall.
    • Non-targeted group-chat recall and recall in single-character chats retain their existing chat-wide behavior.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Agents/pull/1196 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 10/2/2026 **Status:** ✅ Merged **Merged:** 10/2/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `fix(long-term-memory)/targeted-group-recall` --- ### 📝 Commits (2) - [`401f08b`](https://github.com/Pasta-Devs/Marinara-Agents/commit/401f08b3c81b7e8b6557eb73269fddf1aaf9c11f) fix(long-term-memory): 1.3.39 — targeted group recall returns only the responder's memories (#1194) - [`612b244`](https://github.com/Pasta-Devs/Marinara-Agents/commit/612b244a1f0e2f7bed842e12b28143661f348431) test(long-term-memory): cover targeted filtering after the group grows (#1194) ### 📊 Changes **14 files changed** (+175 additions, -62 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/long-term-memory-1.3.39.zip` (+0 -0) 📝 `catalog/catalog.json` (+6 -6) 📝 `catalog/notes.json` (+6 -6) 📝 `catalog/v2/catalog.json` (+6 -6) 📝 `catalog/v2/notes.json` (+6 -6) 📝 `catalog/v3/catalog.json` (+6 -6) 📝 `catalog/v3/notes.json` (+6 -6) 📝 `packages/long-term-memory/CHANGELOG.md` (+4 -0) 📝 `packages/long-term-memory/manifest.json` (+3 -3) 📝 `packages/long-term-memory/server.mjs` (+22 -22) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/generation-injection.ts` (+13 -0) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/retrieval.ts` (+10 -0) 📝 `scripts/build-feature-packages.mjs` (+1 -1) 📝 `tests/long-term-memory-runtime.regression.ts` (+86 -0) </details> ### 📄 Description # Pull request > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- Open as a draft while implementation is in progress. Mark Ready for review only after validation and self-review. --> ## Linked issue <!-- Every PR should reference an issue or feature request. --> Closes #1194 ## Why this change <!-- What user problem, package bug, or catalog goal does this solve? --> - In a multi-character group chat the Engine targets one responder and passes that responder's id in `promptCharacterIds`, but Long-Term Memory ignored it and recalled every chat character's memories plus global, chat-only, persona-only, mixed-character, and foreign-character/shared-chat notes. A targeted responder could receive memories that belong to another character. ## What changed <!-- Include affected package IDs and generated outputs. --> - `long-term-memory` `1.3.39`: `prepareGenerationLongTermMemory` treats a non-empty strict subset of a multi-character chat's characters as the targeted responder, and passes an explicit `exclusiveCharacterIds` signal into retrieval. - `retrieveLongTermMemory` applies the restriction only when that option is set: an eligible note must have non-empty `scope.characterIds` and every id must be in the target set. Global, chat-only, persona-only, mixed-character, and other characters' shared-chat notes are excluded; a non-targeted full-set handoff or a single-character chat keeps today's chat-wide behavior. - Added the #1194 runtime regression (target A and B isolation, shared-scope exclusions, full-set preservation, empty and unknown target fallback). - Rebuilt generated outputs: `manifest.json`, `server.mjs`, `artifacts/long-term-memory-1.3.39.zip`, catalog v2/v3 lanes and the legacy alias, and `notes.json` release notes; `client.js` unchanged. - `npm run check` (`prettier`/`eslint`) passes; other callers of `matchesLtmScope`/`ltmScopesOverlap` (`GET /notes`, transfer, extraction, reconciliation, `subject-identity`, `/search`) are unchanged because the new option is opt-in from generation only. ## Package and security impact - Affected package IDs: `long-term-memory` - Engine compatibility impact: none; `engine.min`/`maxExclusive` unchanged (`>=2.4.1 <4.0.0`), capability API 1.6 unchanged. The Engine already supplies the target ids; no Engine change is required. - New or changed permissions/entrypoints: none (permissions and entrypoints unchanged). - Restart, storage, update, or uninstall impact: none; only generation recall filtering changed. Data-loss/trust boundary unchanged. ## Validation <!-- These are human tasks. Never tick a box for a check that was not actually performed. --> - [ ] `node scripts/validate-catalog.mjs` passes locally - [ ] `git diff --check` passes locally - [ ] Rebuilt every affected manifest, payload, artifact, and catalog entry - [ ] Installed or updated the affected package through Marinara Engine - [ ] Checked supported modes, restart behavior, and uninstall cleanup - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes <!-- Describe exactly what you tested, step by step. --> - Repository-required gates on the final commit, all exit 0: `npm run check`; `node scripts/test-catalog-lanes.mjs`; `node scripts/validate-package-locales.mjs`; `node scripts/validate-catalog.mjs`; `node scripts/tests/catalog-release-notes.regression.mjs`; `git diff --check`. - Long-Term Memory regressions on the final commit, all exit 0: `runtime`, `scope-targets`, `routes`, `routes-notes`, `routes-scope-identity`, `storage`, `local-characters`, `installation`. - The `installation` regression installs the exact committed `long-term-memory-1.3.39.zip` and covers install, offline restart, full-backup inclusion, uninstall, reinstall, and durable-byte preservation against the real Engine host runtime. - Artifact SHA-256: `4a1ee518310f58285effc2583f075ca2d742880ea230ac04fa656c793026d19e`. - Hosted CI and live group-chat/browser validation have not been run yet; they remain pending for this commit. No checkbox above is claimed as performed by this PR author. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence (if applicable) <!-- Add before/after screenshots or recordings for package UI changes. --> - Not applicable: no client or UI change. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Long-Term Memory 1.3.39 now limits group-chat recall for a character-targeted response to memories scoped to that character. Memories scoped to other characters, the chat generally, or a persona are not included in that targeted recall. * Non-targeted group-chat recall and recall in single-character chats retain their existing chat-wide behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-21 05:09:13 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#1341
No description provided.