mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[GH-ISSUE #1550] [Issue]: Long-Term Memory: a structured summary reads a name starting with Char or Rel as an id, so its section hint and lines are lost #1518
Labels
No labels
agent: chess
agent: conversation-calls
agent: eightball
agent: haptic
agent: hierarchical-maps
agent: hierarchical-maps
agent: illustrator
agent: poker
agent: rock-paper-scissors
agent: tic-tac-toe
agent: uno
artifacts
bug
bugfix
build
catalog
ci
client
dependencies
docs
documentation
enhancement
feature
fixed-in-staging
in-pr
normal-scope
packages
pull-request
qol
regression
roadmap
scope-risk
server
soup
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Agents#1518
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?
Originally created by @Promansis on GitHub (Oct 21, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1550
Originally assigned to: @Promansis on GitHub.
Summary
When a structured chat summary writes a character's name out (
- Char Aznable | …,character: Char Aznable,- Char Aznable: …, or a leading pair such as- Rel Varga, Sayla Mass | …), the summary parser reads the name as if it were a memory id: it removes a leadingchar_orrel_once. A name that starts with that word loses it. "Char Aznable" becomesaznable, and the pair "Rel Varga, Sayla Mass" becomesvarga_sayla_mass. Neither matches anyone in the chat, so:character: Char Aznablewithsection: profile) is stored underaznable. Today it matches only because Char Aznable's facts go to a wrong, shortened memorychar_aznable. Once the facts go to the character's own memorychar_char_aznable(the prefix-word memory id fix, #1543, PR #1548), the hint misses and the fact takes its section from its wording instead, for example Items for "carries a red pendant".A line that writes the id made from the name instead (
subject: char_aznable, the form the Engine's built-in LTM summary prompt asks for) loses the word the same way. That case is not fixed here (see Not included).Affected package
long-term-memory1.4.76 (upstream/staging79d45f80e) with the #1543 fix (PR #1548, 1.4.77).S=packages/long-term-memory/src/engine/packages/server/src/services/long-term-memoryExpected behavior
A character or relationship whose name a structured summary writes out is read by its whole name, the way identity reads it. The summary's section hint reaches the character's memory, and its lines are saved to the memory identity chose, whatever the name's first word.
Actual behavior
Line numbers are on that tree (refreshed 2026-10-21; first checked on
6a2dfb7c6), all inS/extraction/structured-summary-normalizer.ts.characterSubject(:1542-1545) reads a section'scharacter:value as an id and removeschar_once, so "Char Aznable" is keyedaznable(structuredSummaryHints,:503).characterSectionKey(:1593-1597) looks the hint up by the fact's subject id. When it misses,structuredCharacterSectionKey(:1599-1604) moves afacts,coreorprofilefact toitemsordevelopmentsby its wording.parseStructuredCharacterLine(:1204) does the same to a summary line, whether the name leads the line (- Char Aznable | …,:1240), sits in a field (character: Char Aznable,:1256) or is the key (- Char Aznable: …,:1297). The subject is stripped at:1315toaznable. The line carries no names, so identity cannot matchaznableto Char Aznable and drops it withuntrusted_subject_identity.parseStructuredRelationshipLine(:743) strips a leading pair (:773) or an id field (:785), and strips again at:851: "Rel Varga, Sayla Mass" isvarga_sayla_mass, dropped the same way. A pair given in acharacters:field keeps its names and is not affected.mara, which identity matches to Mara.Steps to reproduce
Put characters named "Char Aznable", "Mara", "Rel Varga" and "Sayla Mass" in the chat.
Extract from a chat summary in the structured format, with the model returning the pendant fact for Char Aznable:
Both Char Aznable lines are dropped as
untrusted_subject_identitywith subjectaznable, so "leads the Red Comet squadron" is lost; the relationship line is dropped with subjectvarga_sayla_mass, and no relationship memory is created. With "Mara" in place of "Char Aznable" both lines are saved.With the prefix-word memory id fix (#1543, PR #1548) in place, the pendant fact is saved to
char_char_aznableunder Items instead of Profile.Minimal fix
One PR, patch bump. One source file, no new file.
char_mara (Mara),char_mara - Mara) has an underscore in its first word. A name gets the subject id identity gives its memory: the prefix plus the name, then the prefix removed with the prefix-word helper from the #1543 fix (unprefixedSubjectId), so "Char Aznable" ischar_char_aznableand "Mara Lee" ismara_lee. An id is stripped once, as today.character:field, or name as key), and for a relationship line's leading pair or id field. The relationship line's second strip goes; a pair from acharacters:field is stripped once, as before.char_aznable) still takes it.## Unreleased: "Extraction from a structured chat summary now reads a character name that starts with "Char", such as "Char Aznable", or a relationship pair whose first name starts with "Rel", as a name instead of an id when the summary writes the name out. … A line that writes an id made from the name instead, such assubject: char_aznable, is still read as an id."Not included
subject: char_aznablefor Char Aznable), is still read as an id and dropped asaznable. The parser can't tell it apart from a memory id such as Mara'schar_marawithout the chat's character list, which it does not get; passing that list in touchessource-extraction.tsand is a separate follow-up.- char mara | …) now reads as a name and is dropped (it was saved to Mara before). The Engine prompt asks for snake_case ids, so this form is unlikely.aznable, so in a chat that also has a character called "Aznable" it reaches Aznable's memory too, as today.- Char Aznable, Mara | …) is still dropped, as today; the same pair in acharacters:field, or the other way round, is kept.char_char_aznable,rel_rel_varga_sayla_mass) without a space is still stripped once (char_aznable), as today: the section hint misses, and a relationship line is dropped. Changing how written ids fold would also changechar_char_mara, which today means Mara.Char_Aznable) is still read as an id.- Rel Varga and Sayla Mass | …, also- Ana and Bo | …) gives a subject that containsand, which identity can't match, before and after.character:field is still not attached to the line as a name, as today.Regression proof
In
tests/long-term-memory-extraction-graph.regression.ts, at the end of the prefix-word memory id case (added by #1543, PR #1548): runprocessLongTermMemorySourcewith the same roster (Char Aznable, Rel Varga, Sayla Mass, Mara) on a structured summary with acharacter: Char Aznable/section: profilesection, acharacter: Mara/section: profilesection (including two lines written aschar_mara (Mara)), and relationship lines for "Rel Varga, Sayla Mass" (leading pair,relationship:field, a new fact with a cause). The model returns the Char Aznable and Mara facts but no relationship.char_char_aznable,char_maraandrel_rel_varga_sayla_mass; both character memories hold onlyprofile; the field-form line "leads the Red Comet squadron" reacheschar_char_aznable; the twochar_mara (Mara)lines reachchar_mara; nothing is dropped; the cause event reads "rel and varga and sayla and mass relationship changed after the hangar fire."aznable) still takes the summary'sprofile.Without the fix it fails at the first check (no relationship memory), and putting back any one changed line fails one of the checks.
Environment
staging87d1ccadc)upstream/staging79d45f80ewith the #1543 fix, PR #1548)processLongTermMemorySource)Logs, screenshots, or video
None. The reproduction uses fixture names, not user data.
Additional context
Tracker item OT-14. Found while preparing and reviewing the prefix-word memory id fix (#1543, PR #1548), which must land first: this fix uses its helper and adds to its test case.
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@Promansis commented on GitHub (Oct 21, 2026):
Fixed in staging by #1552 (long-term-memory 1.4.79).