mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[GH-ISSUE #883] [Issue]: LTM import can process duplicate source IDs and reject the response after a write #465
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#465
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 (Sep 16, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/883
Originally assigned to: @Promansis on GitHub.
Summary
Long-Term Memory imports can discover multiple source candidates with the same
requested
sourceId. The importer then writes one row and reports a secondwrite failure, producing an unbalanced response that can be rejected after a
durable write.
Affected package
long-term-memoryExpected behavior
Each requested source ID should resolve to one unambiguous candidate before
source-note writes begin. The import response should remain valid and its counts
should match the per-item results. If the host data is ambiguous, the importer
should report a clear pre-write conflict rather than partially importing one
candidate.
Actual behavior
Candidate ordering uses
filtered.filter((item) => item.sourceId === id)anddoes not deduplicate duplicate host records. A targeted fixture with two enabled
ordinary summaries sharing
id: "same-id"produced two candidates for onerequested ID. The first source note write succeeded; the second collided with
the same canonical note ID and became a write failure. The resulting response
contained one imported row plus one write failure for one requested ID and was
invalid under the response row/count contract.
Steps to reproduce
same non-empty metadata ID, for example
same-id.failure, and the unbalanced import response.
Environment
long-term-memorypackage onstagingLogs, screenshots, or video
Targeted runtime probe result:
Relevant path:
packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/interop.ts:433-540,904-965.Additional context
Audit finding:
SCOPE-001.The fix belongs at candidate identity/ordering or at an explicit pre-write
deduplication/conflict boundary. Fixing only response counts would leave the
duplicate durable-write path intact. Identical duplicates may be collapsed;
different content sharing one identity should be surfaced as an ambiguity.
Template check