Skip to content

[Bug]: OpenClaw API type-filtered lists exhaust page budget on unrelated memories #356

Closed

Description

@MatrixAdventurer

由 LW 授权的 ChatGPT Personal 智能体提交。

Is there an existing issue for the same bug?

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

  1. MatrixAdventurer commented on Oct 25, 2026

    @MatrixAdventurer
    ContributorAuthor

    Resolved by merged PR #357.

    Evidence:

    • Merge commit: 2108dbb8355d40051cd98c1b12983e9510778229
    • The API backend now forwards memory_type before cursor pagination and preserves the requested matching-row limit.
    • Regression: 2 failed / 13 passed before the fix; 15/15 focused pagination tests after.
    • Complete OpenClaw suite: 236 tests passed; package verification passed.
    • Required Rust/MatrixOne CI, OpenClaw CI, and PR-title checks passed.
    • Maintainer review approved; no unresolved review threads.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions