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
NodeFilter order_by is never applied anywhere — LIMIT executes over an unordered set, so query_nodes returns an arbitrary (oldest-first) subset while the code documents CreatedDesc, and collection pagination is unstable across calls #2211
ops::query_nodes sets OrderBy::CreatedDesc (ops/node_ops.rs:491) and its pagination comment relies on the set being 'CreatedDesc-ordered', but NodeService::query_nodes only logs 'order_by handled via in-memory sorting after database query' (query.rs:40-44) and no in-memory sort exists anywhere on the path; SqliteStore::query_nodes then applies LIMIT/OFFSET with no ORDER BY (nodes.rs:1034-1041), and the collection-scoped branch iterates a per-call freshly-seeded HashSet of member ids into 900-id IN-chunks (ops/node_ops.rs:401-441, nodes.rs:996-1026), so even the row order the chunks produce differs between two identical calls.
Failure scenario
Database has 250 tasks. Agent tool query_nodes {node_type:"task"} (default limit 100, no explicit sorting — the default enumerate path in packages/agent tools.rs:1914) runs 'SELECT * FROM node WHERE node_type=? LIMIT 100': SQLite returns the first 100 rows in table-scan order ≈ the 100 OLDEST tasks; the newest tasks are silently absent from a listing the code intends to be newest-first. Worse, for a collection with >900 members, paging with offset across two RPC calls chunks the member ids in two different random orders, so page 2 repeats some nodes from page 1 and skips others entirely — items are silently missing from a paginated listing.
Activity
mstomar125 commentedon Aug 28, 2026
Frontend baseline: 4794 passed (227 test files), 0 failed. Starting combined fix with #2212 (same query_nodes function).
Bound QueryNodesSimple/GetRoots and add count-only RPCs (closes #2289) (