fix: memory.list tag filter (#1) + Web UI shared-project visibility (#2) #3

Merged
jknapp merged 3 commits from fix/list-tag-filter-and-shared-project-visibility into main 2026-06-12 19:01:33 +00:00
Showing only changes of commit 30194463b5 - Show all commits
+8 -2
View File
@@ -1,4 +1,4 @@
import { and, desc, eq, inArray, isNull, or, sql } from "drizzle-orm"; import { and, arrayContains, desc, eq, inArray, isNull, or } from "drizzle-orm";
import { db } from "@/lib/db/client"; import { db } from "@/lib/db/client";
import { import {
memories, memories,
@@ -465,7 +465,13 @@ const memoryList: ToolDef = {
} }
if (parsed.data.tags && parsed.data.tags.length > 0) { if (parsed.data.tags && parsed.data.tags.length > 0) {
where.push(sql`${memories.tags} @> ${parsed.data.tags}::text[]`); // Require ALL listed tags (array containment). Use Drizzle's
// arrayContains so the JS array binds as a single text[] param
// (via the column's toDriver) rather than being expanded into
// positional params — a raw `${tags}::text[]` template expands to
// `($1)::text[]` / `($1,$2)::text[]`, which Postgres rejects as a
// malformed array literal / record cast.
where.push(arrayContains(memories.tags, parsed.data.tags));
} }
const rows = await db const rows = await db