[GH-ISSUE #1226] [Issue]: Long-Term Memory: a local character memory with non-Roleplay availability fails the whole import #627

Closed
opened 2026-10-20 17:29:09 +07:00 by bsakaguchi · 0 comments
Owner

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

Originally assigned to: @Promansis on GitHub.

Summary

Extraction can produce a local character memory whose availability includes Conversation or Game. Finalization
then rejects it with "Local character subjects are available only in Roleplay mode.", and the whole source
fails. The Roleplay-only rule is correct; the problem is that the pipeline creates notes its own validator rejects.

Affected package

long-term-memory

Expected behavior

  • When an extracted memory has a local character subject:
    • if Roleplay is among the selected availability modes, restrict that memory to Roleplay and show a warning;
    • if Roleplay is not selected, drop that memory and show a diagnostic explaining why.
  • Other memories from the same source are still proposed.
  • The import is never reported as a hard failure for this reason alone.

Actual behavior

  • Requested 1, wrote 1, succeeded 0, failed 1, with:

    [{ "code": "custom", "path": ["modes"],
       "message": "Local character subjects are available only in Roleplay mode." }]
    
  • Retrying with the same selections fails the same way.

Steps to reproduce

  1. Import a Roleplay chat summary that names a genuinely new minor character (for example "Jordan the innkeeper").
  2. Select Conversation, Roleplay, and Game as availability modes, then click "Import and extract selected".
  3. Extraction fails for the whole source with the error above.

Environment

  • Marinara Engine version: any version supported by the package (>= 2.4.1)
  • Package version: 1.4.4
  • Install type: reproduced at source level (isolated vault, fixed extraction output), Agents ef64aeb7b
  • OS + version: not OS-specific
  • Browser or app shell: not applicable

Logs, screenshots, or video

See the error above.

Additional context

Depends on #1225. Do not merge this before the identity fix. Otherwise a short name for a known
character would produce a "successful" import that creates a duplicate local character.

Where the behavior comes from (at ef64aeb7b):

  • Identity resolution uses the extraction mode (source-extraction.ts:546-553), which is Roleplay for a Roleplay chat.
  • The compiler copies all selected availability modes onto every new note (evidence-unit-compiler.ts:84).
  • Validation: schema.ts:924-930 and schema.ts:2019-2024.

Not in scope:

  • Do not relax the Roleplay-only validator.

Regression proof (each case must fail before the fix):

  • Local subject with all modes selected: the memory is restricted to Roleplay with a warning, and the rest of the source succeeds.
  • Local subject with Roleplay not selected: that memory is dropped with a diagnostic, and the rest of the source succeeds.
  • Trusted character and persona subjects keep every selected mode.

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 5, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1226 Originally assigned to: @Promansis on GitHub. ## Summary Extraction can produce a local character memory whose availability includes Conversation or Game. Finalization then rejects it with "Local character subjects are available only in Roleplay mode.", and the whole source fails. The Roleplay-only rule is correct; the problem is that the pipeline creates notes its own validator rejects. ## Affected package long-term-memory ## Expected behavior - When an extracted memory has a local character subject: - if Roleplay is among the selected availability modes, restrict that memory to Roleplay and show a warning; - if Roleplay is not selected, drop that memory and show a diagnostic explaining why. - Other memories from the same source are still proposed. - The import is never reported as a hard failure for this reason alone. ## Actual behavior - Requested 1, wrote 1, succeeded 0, failed 1, with: [{ "code": "custom", "path": ["modes"], "message": "Local character subjects are available only in Roleplay mode." }] - Retrying with the same selections fails the same way. ## Steps to reproduce 1. Import a Roleplay chat summary that names a genuinely new minor character (for example "Jordan the innkeeper"). 2. Select Conversation, Roleplay, and Game as availability modes, then click "Import and extract selected". 3. Extraction fails for the whole source with the error above. ## Environment - Marinara Engine version: any version supported by the package (>= 2.4.1) - Package version: 1.4.4 - Install type: reproduced at source level (isolated vault, fixed extraction output), Agents `ef64aeb7b` - OS + version: not OS-specific - Browser or app shell: not applicable ## Logs, screenshots, or video See the error above. ## Additional context Depends on #1225. Do not merge this before the identity fix. Otherwise a short name for a known character would produce a "successful" import that creates a duplicate local character. Where the behavior comes from (at `ef64aeb7b`): - Identity resolution uses the extraction mode (`source-extraction.ts:546-553`), which is Roleplay for a Roleplay chat. - The compiler copies all selected availability modes onto every new note (`evidence-unit-compiler.ts:84`). - Validation: `schema.ts:924-930` and `schema.ts:2019-2024`. Not in scope: - Do not relax the Roleplay-only validator. Regression proof (each case must fail before the fix): - [ ] Local subject with all modes selected: the memory is restricted to Roleplay with a warning, and the rest of the source succeeds. - [ ] Local subject with Roleplay not selected: that memory is dropped with a diagnostic, and the rest of the source succeeds. - [ ] Trusted character and persona subjects keep every selected mode. ## 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-10-20 17:29:09 +07:00
  • closed this issue
  • added the
    bug
    label
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#627
No description provided.