[Bug]: OpenClaw API type-filtered lists exhaust page budget on unrelated memories #356
Description
由 LW 授权的 ChatGPT Personal 智能体提交。
Is there an existing issue for the same bug?
- Searched OpenClaw memoryType/filter/list issues and PRs. fix(openclaw): follow list cursors and look up memories by ID #274 covers cursor traversal/direct lookup; fix(openclaw): support episodic memory type #347 covers episodic type acceptance; neither forwards list type filters before pagination.
Environment (optional)
Upstream main e2aa907, OpenClaw API backend, Node24.19.0, Vitest4.1.11. Synthetic data and native loopback HTTP only.
Actual behavior
MemoriaClient.listMemories({memoryType:"episodic", ...}) scans unfiltered API pages and only then discards other types. maxListPages can be exhausted by unrelated memories: a request for one episodic memory returns no items although matching memories exist later. A complete filtered result also gets an irrelevant Rust-MCP client-filter limitation and partial flag.
The API already applies ListQuery.memory_type before its keyset-page limit. The OpenClaw client never passes this selector into MemoriaHttpTransport, whose pagination omits it.
Expected behavior
For the API backend, send the existing memory_type selector on every cursor page and use the caller's requested limit, so page budget counts matching rows. Preserve cursor/partial semantics. Keep the embedded MCP fallback and unfiltered calls unchanged.
Steps to reproduce
A native loopback HTTP fixture models the existing REST contract with five records: two semantic followed by three episodic, and a two-row page cap.
- limit1/maxListPages1: original returns [] instead of the first episodic record.
- limit3/maxListPages2: original returns only two episodic records instead of all three.
Actual original regression: 2 failed /13 passed in the existing pagination suite; candidate: 15/15. Complete plugin suite: 236 passed, and npm run test:pack passed (6 packed files). No live database data was accessed.
Additional information
Complete candidate: 3 files, +60/-4; client, existing HTTP transport and existing pagination tests. No API/Rust/schema/dependency/workflow/generated-source change. The package build generates ignored dist output through the normal build step. Independent review and repository CI status are recorded separately; this does not claim live MatrixOne or whole Rust/DB validation.
Authenticated MatrixAdventurer and own fork MatrixAdventurer/memoria -> matrixorigin/memoria with push permission were checked. No exact dev exists; main fallback is explicitly authorized. Planned own-fork feature branch fix/openclaw-list-type-filter-20261023. Branch/commit/Issue/PR writes and read-only verification are by the signed execution subject; no upstream/default branch push, automatic merge, deployment or issue closure.
由 LW 授权的 ChatGPT Personal 智能体提交。
Activity
fix(openclaw): filter API memory lists before pagination (#357)
MatrixAdventurer commentedon Oct 25, 2026
Resolved by merged PR #357.
Evidence:
2108dbb8355d40051cd98c1b12983e9510778229memory_typebefore cursor pagination and preserves the requested matching-row limit.