[GH-ISSUE #1934] [Feature]: Long-Term Memory: register the runtime service host-only #1829

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

Originally created by @Promansis on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1934

Originally assigned to: @Promansis on GitHub.

What problem does this solve?

Long-Term Memory registers long-term-memory:runtime with api.registerService, and any installed package can read it through runtime.services.get. That service gives recall for any chat id, recordPromptAccepted and withVaultMutation (the vault lock). Only the Engine should call it: generation (long-term-memory-runtime.ts) and backup restore (backup.routes.ts). Slurp and Noodle read long-term-memory:recall, which stays open to packages.

Engine #8413 (Capability API 1.388, closes Pasta-Devs/Marinara-Engine#8408) added api.registerService(key, service, { hostOnly: true }): a host-only service still reaches the Engine, but packages get null from services.get.

Proposed package or change

Long-Term Memory registers long-term-memory:runtime with { hostOnly: true }. long-term-memory:recall stays as it is.

No engine.min bump: an Engine before 1.388 ignores the third argument, so the service keeps working there and stays readable as it is today. Server only, no UI, no permission change. Patch release.

Minimal fix

  • packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/server-entry.ts: widen the local Api.registerService type with options?: { hostOnly?: boolean } and pass { hostOnly: true } on the long-term-memory:runtime registration (~line 39).
  • packages/long-term-memory/docs/ARCHITECTURE.md (~line 15): say the runtime service is host-only from Capability API 1.388.
  • Regression: in tests/long-term-memory-runtime.regression.ts, the fake api.registerService (~line 244) records each key's options; assert long-term-memory:runtime is registered hostOnly: true and long-term-memory:recall is not.
  • packages/long-term-memory/CHANGELOG.md under ## Unreleased.

Non-goals: a key-prefix rule in the Engine; changing long-term-memory:recall; Slurp and Noodle.

Why should this be optional?

It is part of the existing optional Long-Term Memory package; it narrows who can call a service the package already registers.

Alternatives considered

Raising engine.min to the first Engine with API 1.388. Not needed, since older Engines ignore the option, and no release has it yet (latest v2.5.1).

Additional context

Tracker SN-7 (design note Q8). Engine side: Pasta-Devs/Marinara-Engine#8408, Pasta-Devs/Marinara-Engine#8413.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Oct 30, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1934 Originally assigned to: @Promansis on GitHub. ## What problem does this solve? Long-Term Memory registers `long-term-memory:runtime` with `api.registerService`, and any installed package can read it through `runtime.services.get`. That service gives recall for any chat id, `recordPromptAccepted` and `withVaultMutation` (the vault lock). Only the Engine should call it: generation (`long-term-memory-runtime.ts`) and backup restore (`backup.routes.ts`). Slurp and Noodle read `long-term-memory:recall`, which stays open to packages. Engine #8413 (Capability API 1.388, closes Pasta-Devs/Marinara-Engine#8408) added `api.registerService(key, service, { hostOnly: true })`: a host-only service still reaches the Engine, but packages get `null` from `services.get`. ## Proposed package or change Long-Term Memory registers `long-term-memory:runtime` with `{ hostOnly: true }`. `long-term-memory:recall` stays as it is. No `engine.min` bump: an Engine before 1.388 ignores the third argument, so the service keeps working there and stays readable as it is today. Server only, no UI, no permission change. Patch release. ## Minimal fix - `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/server-entry.ts`: widen the local `Api.registerService` type with `options?: { hostOnly?: boolean }` and pass `{ hostOnly: true }` on the `long-term-memory:runtime` registration (~line 39). - `packages/long-term-memory/docs/ARCHITECTURE.md` (~line 15): say the runtime service is host-only from Capability API 1.388. - Regression: in `tests/long-term-memory-runtime.regression.ts`, the fake `api.registerService` (~line 244) records each key's options; assert `long-term-memory:runtime` is registered `hostOnly: true` and `long-term-memory:recall` is not. - `packages/long-term-memory/CHANGELOG.md` under `## Unreleased`. Non-goals: a key-prefix rule in the Engine; changing `long-term-memory:recall`; Slurp and Noodle. ## Why should this be optional? It is part of the existing optional Long-Term Memory package; it narrows who can call a service the package already registers. ## Alternatives considered Raising `engine.min` to the first Engine with API 1.388. Not needed, since older Engines ignore the option, and no release has it yet (latest v2.5.1). ## Additional context Tracker SN-7 (design note Q8). Engine side: Pasta-Devs/Marinara-Engine#8408, Pasta-Devs/Marinara-Engine#8413. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-11-07 16:36:57 +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#1829
No description provided.