[PR #1963] [MERGED] feat(long-term-memory): accept safe changes and import chat sources automatically (1.5.19) #2052

Closed
opened 2026-11-07 16:39:05 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: staging ← Head: feature(long-term-memory)/hands-off-mode


📝 Commits (6)

  • 71ff3f1 feat(long-term-memory): accept safe changes automatically (#1962)
  • f882621 feat(long-term-memory): import new chat sources in the background (#1962)
  • 553a75f chore(long-term-memory): changelog for #1962
  • 0e35f14 chore(long-term-memory): release 1.5.19 (#1962)
  • 6bfadaa fix(long-term-memory): block a background import that leaves its source unfinished (#1962)
  • 7c0a6ca fix(long-term-memory): block a background import that leaves an edited source unfinished (#1962)

📊 Changes

33 files changed (+786 additions, -146 deletions)

View changed files

➕ artifacts/long-term-memory-1.5.19.zip (+0 -0)
📝 catalog/catalog.json (+8 -8)
📝 catalog/notes.json (+6 -6)
📝 catalog/v2/catalog.json (+8 -8)
📝 catalog/v2/notes.json (+6 -6)
📝 catalog/v3/catalog.json (+8 -8)
📝 catalog/v3/notes.json (+6 -6)
📝 packages/long-term-memory/CHANGELOG.md (+5 -0)
📝 packages/long-term-memory/client.js (+25 -25)
📝 packages/long-term-memory/docs/UI.md (+14 -0)
📝 packages/long-term-memory/manifest.json (+5 -5)
📝 packages/long-term-memory/server.mjs (+52 -52)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/PRODUCT.md (+4 -4)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/locales/en.json (+9 -1)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/locales/ko.json (+9 -1)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/settings/ActivityView.tsx (+1 -0)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/settings/MemorySettings.tsx (+25 -0)
📝 packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/sources/SourcesWorkspace.tsx (+18 -5)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/drafts/reconciliation.ts (+20 -0)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/extraction-config.ts (+2 -0)

...and 13 more files

📄 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 #1962

Why this change

  • Long-Term Memory needs a person at every step: each import or extraction stops in the Review Queue, and new chat summaries and message pieces sit in Sources until someone imports them. In a long chat, that means memory falls behind unless the user keeps going back to it.
  • This bundle adds two opt-in Memory Settings → Extraction switches that let the package keep up on its own. Both default to off, and everything they do is logged in Activity and vault history.

What changed

Package: long-term-memory 1.5.18 → 1.5.19.

 Memory Settings → Extraction
+  [ ] Accept safe changes automatically      (autoAcceptSafeChanges, default false)
+  [ ] Import new chat sources automatically  (autoImportChatSources, default false)
  1. Accept safe changes automatically (OT-3). After an import or extraction, low-risk proposals are applied when the request does not say otherwise. A draft that also holds a rewrite now applies its safe rows and leaves the rewrite in review, instead of failing the whole auto-apply.
  2. Import new chat sources automatically. A background job runs per chat:
recall for a generation (reply in chat X)
  armLtmAutoImport(root, X)           # 2 s quiet period, at most 10 s after the first reply
    runLtmAutoImport
      setting still on? chat still there?
      for source in [chats, messages]
        preview the chat's "Current chat" sources
        keep new / source-updated / incomplete rows,
          only X's own summaries, never the open (still-growing) message piece,
          at most 100 per source per run
        same selection failed last time? skip until its sources change
        importPackageInterop(..., extract: true, chatId: X)
        log to Activity: "Imported N … in the background" or the failure
package deactivation
  stopLtmAutoImport  → drop timers, abort running imports, then stop the index rebuild

The job never delays recall: it is armed from recall and runs outside the vault lock after the quiet period. With item 1 on, its proposals land; without it, they wait in the Review Queue as before.

  • Generated outputs: packages/long-term-memory/{client.js,server.mjs,manifest.json}, artifacts/long-term-memory-1.5.19.zip, catalog/{,v2/,v3/}{catalog,notes}.json, all rebuilt with node scripts/build-feature-packages.mjs long-term-memory.
  • Docs: package PRODUCT.md (the opt-in automatic acceptance and background import), docs/UI.md, en/ko locales (ko machine-written, awaiting a Korean reviewer like the rest of ko).

Bundle items

Each item was reviewed and committed on its own. The squash merge flattens them, so to undo one item, revert the changes of the commits listed for it.

  1. Accept safe changes automatically (Extraction setting) and apply the safe part of mixed drafts (OT-3): 71ff3f1e4 feat(long-term-memory): accept safe changes automatically (#1962)
  2. Import new chat sources automatically (background import on recall): f88262190 feat(long-term-memory): import new chat sources in the background (#1962)

Then 553a75fd2 writes the changelog and 0e35f147a releases 1.5.19. 6bfadaa7e (item 2, Dottore repair) counts a background import that leaves its source without a fingerprint as unfinished, so the same selection is not extracted after every reply. 7c0a6ca59 (item 2, follow-up to Dottore's open question) does the same for an edited source: each imported result now says whether the extraction saved the source's current fingerprint (markedCurrent, optional in the shared result schema), because an edited source that drops units keeps its old fingerprint.

Package and security impact

  • Affected package IDs: long-term-memory
  • Engine compatibility impact: none; engine.min stays 2.5.1, no new Capability API use.
  • New or changed permissions/entrypoints: none. The manifest only changes version and hashes; the background import calls the existing import path in the server bundle.
  • Restart, storage, update, or uninstall impact: two new boolean settings, read as false when absent, so existing vaults behave as before. Background jobs live in memory only, are unref'd timers, and stop on deactivation before the index rebuild stops. No new storage files; uninstall is 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

Agent-run, not a substitute for the boxes above. All exit 0, with MARINARA_AGENTS_ROOT set to the worktree and MARINARA_ENGINE_ROOT set to a read-only Engine checkout:

  • On the changelog head 553a75fd2 (whole bundle): LTM suites storage, extraction-graph, runtime, chat-transcript-import, routes, host-styles, browser; npm run check; npm run typecheck:packages; git diff --check; test-catalog-lanes, validate-package-locales, validate-catalog, catalog-release-notes regression.
  • On the release head 0e35f147a (rebuilt 1.5.19 outputs): test-catalog-lanes, validate-package-locales, validate-catalog, catalog-release-notes regression, npm run check, LTM runtime, host-styles, browser.
  • On the repair head 6bfadaa7e (rebuilt 1.5.19 outputs): LTM chat-transcript-import, runtime, routes, host-styles, browser; npm run check; npm run typecheck:packages; the four catalog validators; git diff --check. The new regression (an extraction that drops a unit, two replies, one model call) was mutation-checked: without the fix the model is called twice.
  • On the follow-up head 7c0a6ca59 (rebuilt 1.5.19 outputs): the same suites and checks. The new regression (a summary imported cleanly, then edited so it shows source_updated, then re-extracted with a dropped unit) was mutation-checked: with the old fingerprint check the import is logged ok and the edit is extracted after every reply.
  • Regression coverage added: the safe part of a mixed draft applies while its rewrite stays pending, and an import with no explicit request follows the setting (item 1); a reply imports the chat's summaries and closed pieces, a branch never imports a sibling's summaries (mutation-checked: fails without the ${chatId}: filter), turning the setting off cancels a waiting run, recall arms the import only with the setting on, deactivation drops a pending import, and both settings save (item 2).
  • Not covered by tests: the 10 s max wait, the re-run armed by a reply during a run, and aborting an import mid-run.
  • Not done: install through a running Marinara Engine.

Documentation impact

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

Package docs updated: packages/long-term-memory/CHANGELOG.md, the package PRODUCT.md, docs/UI.md.

Merge Danger

Door: two-way. Both behaviours sit behind settings that default to off; reverting the squash commit removes them, and saved true values are ignored by older versions.

Blast Radius: opt-in

With "Accept safe changes automatically" on, low-risk memories land without a review; they stay visible in Activity and vault history. Known follow-ups, not changed here:

  • Re-extract messages in Sources and the Review Queue still say the result goes to review when that setting is on.
  • With "Hide imported messages" on and auto-accept off, imported pieces are hidden while their memories still wait in review (the help text says so).
  • On a local backend that runs one request at a time, a background import can queue behind or ahead of the next generation (2 s quiet period).

UI evidence (if applicable)

Two new switches in Memory Settings → Extraction and a new Activity entry kind; covered by the browser suite, no screenshots attached.

🤖 Generated with Claude Code


🔄 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/1963 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `feature(long-term-memory)/hands-off-mode` --- ### 📝 Commits (6) - [`71ff3f1`](https://github.com/Pasta-Devs/Marinara-Agents/commit/71ff3f1e49654c2ae55b7c47f73a39cdf0c541a5) feat(long-term-memory): accept safe changes automatically (#1962) - [`f882621`](https://github.com/Pasta-Devs/Marinara-Agents/commit/f8826219047c4f37aeee797b4b1662862f8c6aae) feat(long-term-memory): import new chat sources in the background (#1962) - [`553a75f`](https://github.com/Pasta-Devs/Marinara-Agents/commit/553a75fd2364eb52c0b937ecfcdf7caca0738734) chore(long-term-memory): changelog for #1962 - [`0e35f14`](https://github.com/Pasta-Devs/Marinara-Agents/commit/0e35f147ad28892b477c2eba897b3472c926ea17) chore(long-term-memory): release 1.5.19 (#1962) - [`6bfadaa`](https://github.com/Pasta-Devs/Marinara-Agents/commit/6bfadaa7eca14180baa9af342700cc6fcdbf7c31) fix(long-term-memory): block a background import that leaves its source unfinished (#1962) - [`7c0a6ca`](https://github.com/Pasta-Devs/Marinara-Agents/commit/7c0a6ca59ce783b594036c19dd9b76792b67ee31) fix(long-term-memory): block a background import that leaves an edited source unfinished (#1962) ### 📊 Changes **33 files changed** (+786 additions, -146 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/long-term-memory-1.5.19.zip` (+0 -0) 📝 `catalog/catalog.json` (+8 -8) 📝 `catalog/notes.json` (+6 -6) 📝 `catalog/v2/catalog.json` (+8 -8) 📝 `catalog/v2/notes.json` (+6 -6) 📝 `catalog/v3/catalog.json` (+8 -8) 📝 `catalog/v3/notes.json` (+6 -6) 📝 `packages/long-term-memory/CHANGELOG.md` (+5 -0) 📝 `packages/long-term-memory/client.js` (+25 -25) 📝 `packages/long-term-memory/docs/UI.md` (+14 -0) 📝 `packages/long-term-memory/manifest.json` (+5 -5) 📝 `packages/long-term-memory/server.mjs` (+52 -52) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/PRODUCT.md` (+4 -4) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/locales/en.json` (+9 -1) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/locales/ko.json` (+9 -1) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/settings/ActivityView.tsx` (+1 -0) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/settings/MemorySettings.tsx` (+25 -0) 📝 `packages/long-term-memory/src/engine/packages/client/src/features/long-term-memory/sources/SourcesWorkspace.tsx` (+18 -5) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/drafts/reconciliation.ts` (+20 -0) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/extraction/extraction-config.ts` (+2 -0) _...and 13 more files_ </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`. ## Linked issue Closes #1962 ## Why this change - Long-Term Memory needs a person at every step: each import or extraction stops in the Review Queue, and new chat summaries and message pieces sit in Sources until someone imports them. In a long chat, that means memory falls behind unless the user keeps going back to it. - This bundle adds two opt-in Memory Settings → Extraction switches that let the package keep up on its own. Both default to off, and everything they do is logged in Activity and vault history. ## What changed Package: `long-term-memory` 1.5.18 → 1.5.19. ```diff Memory Settings → Extraction + [ ] Accept safe changes automatically (autoAcceptSafeChanges, default false) + [ ] Import new chat sources automatically (autoImportChatSources, default false) ``` 1. **Accept safe changes automatically** (OT-3). After an import or extraction, low-risk proposals are applied when the request does not say otherwise. A draft that also holds a rewrite now applies its safe rows and leaves the rewrite in review, instead of failing the whole auto-apply. 2. **Import new chat sources automatically.** A background job runs per chat: ```text recall for a generation (reply in chat X) armLtmAutoImport(root, X) # 2 s quiet period, at most 10 s after the first reply runLtmAutoImport setting still on? chat still there? for source in [chats, messages] preview the chat's "Current chat" sources keep new / source-updated / incomplete rows, only X's own summaries, never the open (still-growing) message piece, at most 100 per source per run same selection failed last time? skip until its sources change importPackageInterop(..., extract: true, chatId: X) log to Activity: "Imported N … in the background" or the failure package deactivation stopLtmAutoImport → drop timers, abort running imports, then stop the index rebuild ``` The job never delays recall: it is armed from recall and runs outside the vault lock after the quiet period. With item 1 on, its proposals land; without it, they wait in the Review Queue as before. - Generated outputs: `packages/long-term-memory/{client.js,server.mjs,manifest.json}`, `artifacts/long-term-memory-1.5.19.zip`, `catalog/{,v2/,v3/}{catalog,notes}.json`, all rebuilt with `node scripts/build-feature-packages.mjs long-term-memory`. - Docs: package PRODUCT.md (the opt-in automatic acceptance and background import), docs/UI.md, en/ko locales (ko machine-written, awaiting a Korean reviewer like the rest of `ko`). ## Bundle items Each item was reviewed and committed on its own. The squash merge flattens them, so to undo one item, revert the changes of the commits listed for it. 1. Accept safe changes automatically (Extraction setting) and apply the safe part of mixed drafts (OT-3): 71ff3f1e4 feat(long-term-memory): accept safe changes automatically (#1962) 2. Import new chat sources automatically (background import on recall): f88262190 feat(long-term-memory): import new chat sources in the background (#1962) Then `553a75fd2` writes the changelog and `0e35f147a` releases 1.5.19. `6bfadaa7e` (item 2, Dottore repair) counts a background import that leaves its source without a fingerprint as unfinished, so the same selection is not extracted after every reply. `7c0a6ca59` (item 2, follow-up to Dottore's open question) does the same for an edited source: each imported result now says whether the extraction saved the source's current fingerprint (`markedCurrent`, optional in the shared result schema), because an edited source that drops units keeps its old fingerprint. ## Package and security impact - Affected package IDs: `long-term-memory` - Engine compatibility impact: none; `engine.min` stays 2.5.1, no new Capability API use. - New or changed permissions/entrypoints: none. The manifest only changes version and hashes; the background import calls the existing import path in the server bundle. - Restart, storage, update, or uninstall impact: two new boolean settings, read as `false` when absent, so existing vaults behave as before. Background jobs live in memory only, are unref'd timers, and stop on deactivation before the index rebuild stops. No new storage files; uninstall is 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 Agent-run, not a substitute for the boxes above. All exit 0, with `MARINARA_AGENTS_ROOT` set to the worktree and `MARINARA_ENGINE_ROOT` set to a read-only Engine checkout: - On the changelog head `553a75fd2` (whole bundle): LTM suites storage, extraction-graph, runtime, chat-transcript-import, routes, host-styles, browser; `npm run check`; `npm run typecheck:packages`; `git diff --check`; `test-catalog-lanes`, `validate-package-locales`, `validate-catalog`, `catalog-release-notes` regression. - On the release head `0e35f147a` (rebuilt 1.5.19 outputs): `test-catalog-lanes`, `validate-package-locales`, `validate-catalog`, `catalog-release-notes` regression, `npm run check`, LTM runtime, host-styles, browser. - On the repair head `6bfadaa7e` (rebuilt 1.5.19 outputs): LTM chat-transcript-import, runtime, routes, host-styles, browser; `npm run check`; `npm run typecheck:packages`; the four catalog validators; `git diff --check`. The new regression (an extraction that drops a unit, two replies, one model call) was mutation-checked: without the fix the model is called twice. - On the follow-up head `7c0a6ca59` (rebuilt 1.5.19 outputs): the same suites and checks. The new regression (a summary imported cleanly, then edited so it shows `source_updated`, then re-extracted with a dropped unit) was mutation-checked: with the old fingerprint check the import is logged `ok` and the edit is extracted after every reply. - Regression coverage added: the safe part of a mixed draft applies while its rewrite stays pending, and an import with no explicit request follows the setting (item 1); a reply imports the chat's summaries and closed pieces, a branch never imports a sibling's summaries (mutation-checked: fails without the `${chatId}:` filter), turning the setting off cancels a waiting run, recall arms the import only with the setting on, deactivation drops a pending import, and both settings save (item 2). - Not covered by tests: the 10 s max wait, the re-run armed by a reply during a run, and aborting an import mid-run. - Not done: install through a running Marinara Engine. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation Package docs updated: `packages/long-term-memory/CHANGELOG.md`, the package PRODUCT.md, `docs/UI.md`. ## Merge Danger **Door:** two-way. Both behaviours sit behind settings that default to off; reverting the squash commit removes them, and saved `true` values are ignored by older versions. **Blast Radius:** opt-in With "Accept safe changes automatically" on, low-risk memories land without a review; they stay visible in Activity and vault history. Known follow-ups, not changed here: - Re-extract messages in Sources and the Review Queue still say the result goes to review when that setting is on. - With "Hide imported messages" on and auto-accept off, imported pieces are hidden while their memories still wait in review (the help text says so). - On a local backend that runs one request at a time, a background import can queue behind or ahead of the next generation (2 s quiet period). ## UI evidence (if applicable) Two new switches in Memory Settings → Extraction and a new Activity entry kind; covered by the browser suite, no screenshots attached. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:39:05 +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#2052
No description provided.