mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[GH-ISSUE #1277] [Bug] LTM 1.4.7: Potential memory rejection bugs involving empty subjectKeys and zero-valued relationship deltas #651
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#651
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 @tlsiddl on GitHub (Oct 9, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1277
Originally assigned to: @Promansis on GitHub.
Summary
Two potential inconsistencies in LTM 1.4.7's extraction schema and validation logic may cause valid character and relationship memories to be rejected.
The suspected problems are:
subjectKeysarray may prevent fallback to otherwise valid character names.These issues were identified through a separate AI-assisted source-code review. I have not independently verified the relevant code paths or reproduced both suspected conditions.
However, I observed an actual character-memory rejection in my own extraction logs. The same NPC was successfully recognized in other candidates during that extraction operation.
I am attaching anonymized logs and the customizations used in my environment to help investigate whether these behaviors originate from the official validation logic or interact with the applied modifications.
Environment
subjectIdnormalization patch: AppliedImportant: The observed rejection occurred in a modified installation. I have not tested the same extraction using an unmodified official LTM 1.4.7 setup.
Issue 1: Empty
subjectKeysMay Suppress Name-Based ResolutionAccording to the separate source-code analysis, the extraction instructions tell the model not to choose subject keys directly, while the response schema still exposes
subjectKeysas an optional field.Some models may explicitly return an empty array instead of omitting the field.
For example:
The suspected issue is that an explicitly empty
subjectKeysarray may prevent the validator from falling back to the valid name insubjectNames.Expected Behavior
An empty
subjectKeysarray should not suppress valid name-based identity resolution. If no usable subject keys are supplied, the validator should attempt resolution using trusted character names.Requested Check
Please compare validation behavior between an omitted
subjectKeysfield and an explicitly emptysubjectKeys: []field, with otherwise identical valid character names.Issue 2: Zero-Valued Relationship Deltas May Reject Static Memories
The separate analysis also suggested that relationship delta fields may be exposed across memory types, including static character and world facts.
Some models may populate these optional fields with zero-valued entries to represent no actual change.
The suspected validator behavior is that the presence of a relationship delta entry may cause a static memory to fail validation, even if every delta value is zero.
Relationship memories may also receive an additional missing cause-event link error.
Expected Behavior
Static memories should not be rejected solely because an optional relationship delta field contains zero-valued entries indicating no change.
Requested Check
Please verify whether zero-valued relationship delta entries are treated as actual relationship changes and whether this validation applies to unrelated memory types.
Observed Extraction Failure
In my environment, the extraction reported:
The rejected candidate was a static character fact about an existing NPC's abilities.
The rejection diagnostic contained:
However, the same extraction operation successfully recognized Character C in other candidates through exact-name matching.
For example:
Character C was also successfully identified in a relationship memory.
This confirms that a character fact was rejected during subject identity validation despite the NPC being recognized elsewhere in the same extraction operation.
However, this log does not conclusively demonstrate the empty-key fallback bug, because both
subjectNamesandsubjectKeyswere empty in the rejected diagnostic.The zero-valued relationship delta issue was not observed in this extraction.
Expected Behavior
When a character can be reliably identified using trusted names, existing bound memories, or available source context, valid character facts should be retained.
If identity resolution remains ambiguous, keeping the candidate available for manual review or correction may be preferable to discarding it.
Requested Investigation
Could you please check:
subjectKeysarrays suppress valid name-based resolution.Attached Evidence and Customizations
I have prepared a ZIP archive containing:
README.md— Environment and attachment informationredacted_log_1.json— Anonymized extraction diagnosticsredacted_log_2.json— Anonymized extraction outcome and rejected candidatehangul_subjectid_patch.cjs— Applied server-side Korean subject ID patchLTM_extraction_prompt_ko.txt— Custom LTM extraction prompt used in this environmentThe logs use consistent pseudonyms for character names and anonymized identifiers.
The Mallang Memory Helper extension package and custom chat summary prompt are not included initially, but I can provide them if needed.
Because a third-party server-side patch and custom extraction prompts were applied, I cannot rule out an interaction with these modifications.
I would appreciate confirmation of whether the two suspected validation behaviors exist in the unmodified official LTM 1.4.7 implementation.
Thank you for looking into this.
LTM_1.4.7_GitHub_minimal_evidence.zip
@Promansis commented on GitHub (Oct 9, 2026):
I checked this against LTM 1.4.20 (current
staging,7b4c6b4). Both suspected bugs are real, exist in the unmodified official code, and are still present in 1.4.20. The extraction, subject-identity and validation files are unchanged between 1.4.7 and 1.4.20. A reproduction script run against both versions on stock source (no Korean patch, no custom prompt) gave identical results, and the shippedserver.mjsbundle contains the same checks.The rejection in your log is a third problem, covered below: the server has no way to recover a Korean character's identity when
subjectNamesis missing.1.
subjectKeys: []blocks name-based resolution: confirmedresolveUnitSubjectstakes the trusted-key path wheneversubjectKeysis defined, including when it is[]. Zero keys is not the expected 1 (character) or 2 (relationship), so it returns a cardinality failure. Name-based resolution (resolveNamedUnitSubjects) only runs whensubjectKeys === undefined.subjectNamessubjectKeysomittedsubjectKeys: []character_factexact_name)invalid_subject_cardinalityrelationship_stateexact_name)invalid_subject_cardinalitysubjectNames: []does not have this problem; it is treated like an omitted field.On question 3, the instructions and schema disagree. The prompt tells the model to never choose subject keys, but the response schema still exposes
subjectKeys.2. Zero-valued
dimensionChangesreject static memories: confirmed, for every memory typestatic_relationship_dimension_changefor anyclaimKind: "static"candidate, of any bucket, that has any key indimensionChanges. Zero values count; only{}passes. The error is mapped to a drop.dimensions/dimensionChangeson every bucket. Only the prompt text says "relationship_state only".relationshipDescribesChangealso treats any key as a change. A static relationship memory with zero deltas and nocaused_bylink therefore also tripsrelationship_state_missing_caused_by. Only the first error is reported, but a fix needs to cover both checks.dimensionChanges{ trust: 0 }world_factcharacter_factrelationship_state3. The observed rejection: a nameless Korean character fact can never be resolved (question 4)
The rejection in the attached log is not Issue 1.
untrusted_subject_identitywithmatchBasis: "trait_or_qualified_alias"is only produced whensubjectKeyswas omitted; an explicit[]givesinvalid_subject_cardinalitywithtrusted_keyinstead. The[]values in the diagnostic are defaults filled in when the diagnostic is written (unit.subjectKeys ?? []).What happened: the model left
subjectNamesoff that candidate, so the server fell back to reading the character fromsubjectId. That fallback works for Latin-script names but can never match a Korean one:subjectIdmust be lowercase ASCII (response schema,normalizeSubjectIdentifier), so the model writes a romanized id such asseo_mujin.normalizeSubjectName, which turns서무진intou1109u1165u1106u116eu110cu1175u11ab.character_factwithoutsubjectNamesis dropped.Verified on 1.4.20 with catalog entries built the way the server builds them:
character_factsubjectId: seo_mujin,subjectNames: ["서무진"]exact_name)subjectId: seo_mujinorseo_mujin_abilities, nosubjectNamesuntrusted_subject_identity (trait_or_qualified_alias)subjectId: maraormara_abilities, nosubjectNamesThat is the exact diagnostic in your log. Each candidate is also resolved independently, so candidate 6 resolving Character C by exact name doesn't carry over to candidate 9. For Korean chats,
subjectNamesis therefore the only path to an identity, and a single omission by the model is a guaranteed loss.subjectNamesis listed as required in the response schema, but the schema usesstrict: false, so providers don't enforce it. YoursubjectIdnormalization patch was applied during this run, so it doesn't cover this path.About the custom prompt: it keeps and strengthens the
subjectNamesrules, so the prompt isn't missing the instruction. It does include two escape hatches: "If the exact character name is not supported by the source, do not invent one or force a character binding" and "If no exact visible name can be resolved unambiguously, do not invent one". They say what not to put insubjectNames, but not what to do with the unit, so a model can reasonably emit the fact without names. For Korean names that is always a drop. A wording that avoids this:The custom prompt does not affect Issue 1, since it never mentions
subjectKeys. For Issue 2 it keeps "static relationships may have dimensions but not dimensionChanges", but it also says "Copy explicit dimensions/dimensionChanges exactly". If the chat summary prompt writes explicit zero relationship deltas, they will still be copied.Recovery (question 5)
Subject-identity drops are stored with a
recoveryCandidate, but the Review Queue's identity choice is only offered for ambiguous matches that carry names. As far as I can see, a nameless untrusted rejection like this one has no way to pick the character.Possible fixes
subjectKeys: []as omitted when normalizing the model response (normalizedEvidenceUnitRecord), or removesubjectKeysfrom the response schema.dimensionChangesbefore validation, and ignoredimensions/dimensionChangeson non-relationship buckets. Restricting them in the schema would also help.character_factorrelationship_stateadopt the identity that a sibling candidate with the samesubjectIdresolved by name. This is the only fallback that works for non-Latin names, and it addresses the rejection in your log: the prompt already asks for onesubjectIdper character, so candidate 9 most likely shared candidate 6's id.Generated by Claude Code
@tlsiddl commented on GitHub (Oct 9, 2026):
Thank you for the detailed investigation and confirmation!
Since both issues were reproduced in the unmodified official build, are there plans to address them in an upcoming LTM update?
I’m particularly concerned about valid character and relationship memories being silently rejected during extraction.
@Promansis commented on GitHub (Oct 9, 2026):
100%, literally working on it rn :) the subjectId has been the bane of my existence forever.
@tlsiddl commented on GitHub (Oct 9, 2026):
Thank you so much for taking the time to investigate this so thoroughly and for working on a fix so quickly!
I really appreciate all the hard work you put into LTM and Marinara Engine. I’ve been having so much fun using them, and LTM is honestly one of my favorite features!
Just wanted you to know that you have people here in Korea who are enjoying your work and cheering you on, too! ❤️
Thank you again for everything you do. I’m really looking forward to seeing how LTM continues to improve! :)
@tlsiddl commented on GitHub (Oct 9, 2026):
I also wanted to ask one more thing!
Would it be possible to integrate Korean character name and subjectId handling into the official LTM implementation?
I’m currently using a custom patch to improve how LTM handles Korean character names, generates and normalizes subjectId values, and validates character identities.
Since you’re already working on the subjectId system, I was wondering if native support for Korean names could be considered as part of those improvements.
I’d love to eventually use LTM without needing a separate server-side patch for Korean names.
I’ve already included the patch source in the ZIP attached to this issue, in case it’s helpful!
Of course, there’s absolutely no pressure! I completely understand that you already have a lot on your plate. Just wanted to share the idea in case it’s something you might consider in the future. :)
@Promansis commented on GitHub (Oct 9, 2026):
Thankyou so much for your kind words and the detailed issue report too! I had no idea, feel free to put any ideas you have forward anytime. Always helpful to have people who are using it provide feedback to improve.
Part of the issue is with non-latin alphabet character names which makes sense why I haven't found that one before!
@Promansis commented on GitHub (Oct 9, 2026):
Absolutely! I will put it into staging tonight or tomorrow morning
@tlsiddl commented on GitHub (Oct 9, 2026):
That would be amazing, thank you so much!
I really appreciate you taking the time to look into this and move it into staging so quickly.
I’m especially happy to hear that Korean / non-Latin character name handling is being considered too.
Once it’s available, I’ll be happy to test it on my side as well. Thanks again for all your hard work! :)
@Promansis commented on GitHub (Oct 10, 2026):
@tlsiddl #1292 should hopefully help out, please let me know if it doesn't. This is a hard one for me to test because of language barrier