Skip to content

Commit 0d09a73

Browse files
rbrennerclaude
andcommitted
fix(mcp): cast uuid to text in waypoints orphan subquery
In PG the memories.id column is uuid and waypoints.src_id/dst_id are text. Comparing them without a cast produces: operator does not exist: text = uuid Cast m.id::text so both sides are text for the NOT EXISTS correlated subquery in openmemory_stats. Co-Authored-By: Claude <noreply@anthropic.com> AI-Generated: true
1 parent adde092 commit 0d09a73

File tree

1 file changed

+1
-1
lines changed
  • packages/openmemory-js/src/ai

1 file changed

+1
-1
lines changed

packages/openmemory-js/src/ai/mcp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ export const create_mcp_srv = () => {
670670
[...params, seven_days_ago],
671671
);
672672
const [orphan_row] = await all_async(
673-
`SELECT COUNT(*) as orphans FROM ${memories_table} m ${where ? where + ' AND' : 'WHERE'} NOT EXISTS (SELECT 1 FROM ${waypoints_table} w WHERE w.src_id = m.id OR w.dst_id = m.id)`,
673+
`SELECT COUNT(*) as orphans FROM ${memories_table} m ${where ? where + ' AND' : 'WHERE'} NOT EXISTS (SELECT 1 FROM ${waypoints_table} w WHERE w.src_id = m.id::text OR w.dst_id = m.id::text)`,
674674
params,
675675
);
676676

0 commit comments

Comments
 (0)