You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
memory: create_entities keeps repeated observations that add_observations would drop, then delete_observations reports "Deleted 2 of 1" #5653
The two write paths treat a repeated observation the same way. Since #5201, add_observations stores a string repeated within one call once; create_entities should do the same, so step 3 returns ["x","y"] and step 4 reports Observations deleted successfully (1 of 1).
Step 4 deletes both copies and returns Deleted 2 of 1 observations., which says more was deleted than was asked. An agent reading it may conclude something else was removed.
delete_observations for ["x"] returns Deleted 2 of 1 observations.
Root cause: createEntities pushes the requested entities unchanged (src/memory/index.ts:886-894), while addObservations normalizes with [...new Set(...)] first (src/memory/index.ts:955-958). deleteObservations counts removed array entries (src/memory/index.ts:1001), so the stored duplicate doubles the reported count.
A one-line dedupe per new entity before the push fixes both symptoms:
In place, because skippedEntityNames (src/memory/index.ts:163) tells skipped entities apart by object identity (created.includes(e)); returning mapped copies instead would report every created entity as skipped. With that change the same repro returns ["x","y"] and Observations deleted successfully, and the memory suite passes (297/297).
Thanks for reproducing this on both 2.2.1 and main, and for tracing it to the missing dedupe in createEntities. The point about skippedEntityNames relying on object identity is a good catch; a mapped-copy fix would have broken that silently.
Are you planning to open a PR with the fix? If not, I'm happy to open one: your in-place dedupe plus a regression test covering
create_entities with duplicate observations stores them once,
delete_observations then reports the correct count.
Credit to you for the root cause, of course.
Correction to my earlier comment: I just re-read CONTRIBUTING.md and this repo accepts issues, not PRs, so I won't open one. The root cause and fix from @yjjnls above, plus the two regression cases I listed, should give the maintainers what they need.
Severity 3: create_entities stores repeated observations that add_observations would drop, and delete_observations then reports deleting more than was asked
Urgency 2: wanted eventually, nothing blocked on it
Bonuses: +1 bug label
Board: Servers V2 (#43), Status Incoming, awaiting maintainer review (no milestone yet).
Activity
yjjnls commentedon Nov 24, 2026
Reproduced on both the published 2.2.1 package and current main (
c799c85), driving the real stdio server with a Python MCP client on a fresh graph:create_entities(A, observations["x","x"]) stores and returns["x","x"]add_observations(["y","y"]) returnsaddedObservations: ["y"]open_nodesreturns"observations": ["x","x","y"]delete_observationsfor["x"]returnsDeleted 2 of 1 observations.Root cause:
createEntitiespushes the requested entities unchanged (src/memory/index.ts:886-894), whileaddObservationsnormalizes with[...new Set(...)]first (src/memory/index.ts:955-958).deleteObservationscounts removed array entries (src/memory/index.ts:1001), so the stored duplicate doubles the reported count.A one-line dedupe per new entity before the push fixes both symptoms:
In place, because
skippedEntityNames(src/memory/index.ts:163) tells skipped entities apart by object identity (created.includes(e)); returning mapped copies instead would report every created entity as skipped. With that change the same repro returns["x","y"]andObservations deleted successfully, and the memory suite passes (297/297).za69956 commentedon Nov 24, 2026
Thanks for reproducing this on both 2.2.1 and main, and for tracing it to the missing dedupe in createEntities. The point about skippedEntityNames relying on object identity is a good catch; a mapped-copy fix would have broken that silently.
Are you planning to open a PR with the fix? If not, I'm happy to open one: your in-place dedupe plus a regression test covering
Credit to you for the root cause, of course.
za69956 commentedon Nov 24, 2026
Correction to my earlier comment: I just re-read CONTRIBUTING.md and this repo accepts issues, not PRs, so I won't open one. The root cause and fix from @yjjnls above, plus the two regression cases I listed, should give the maintainers what they need.
cliffhall commentedon Nov 30, 2026
Triage: Priority Medium (total 6)
create_entitiesstores repeated observations thatadd_observationswould drop, anddelete_observationsthen reports deleting more than was askedbuglabelBoard: Servers V2 (#43), Status
Incoming, awaiting maintainer review (no milestone yet).Merge #5707 (#5653) into the #5693 branch to resolve the createEntiti…
fix(memory): store a repeated observation once in create_entities