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
SqliteStore::query_nodes content_contains branch drops node_type, ids, and title filters — a content search scoped to a type or collection returns nodes of every type #2212
When NodeQuery.content_contains is set, query_nodes returns early with 'SELECT * FROM node WHERE LOWER(content) LIKE ?1 [LIMIT/OFFSET]' (nodes.rs:949-969), ignoring query.node_type, query.ids, and query.title_contains entirely, even though NodeService::query_nodes passes all of them through together (query.rs:56-65), query_nodes_simple's own docs promise 'content_contains + optional node_type' composition (query.rs:267), and ops::query_nodes lets callers combine node_type with a content-contains filter; nothing downstream re-applies the dropped node_type/title conditions (the ops layer re-checks only collection membership).
Failure scenario
Agent calls query_nodes {node_type:"task", filters:[{field:"content", operator:"contains", value:"meeting"}]}. The store runs a content-only full-table LIKE and returns text notes, date pages, and collections containing 'meeting'; nothing filters them out, so the tool's output — which the model then presents to the user as their matching tasks, with a count — includes non-task nodes and a wrong count. The same call scoped to a collection also loses the type constraint (membership is re-checked in memory, node_type is not), and a query combining title-contains with content-contains silently discards the title condition.
Location
packages/core/src/db/sqlite_store/nodes.rs:949
Severity
important
Found via a full-repo adversarial bug sweep, independently verified by two separate skeptical reviewers reading the actual current code before filing.
Activity
mstomar125 commentedon Aug 28, 2026
Frontend baseline: 4794 passed (227 test files), 0 failed. Starting combined fix with #2211 (same query_nodes function).
Bound QueryNodesSimple/GetRoots and add count-only RPCs (closes #2289) (