Skip to content

fix(openclaw): support episodic memory type - #347

Merged
loveRhythm1990 merged 1 commit into
matrixorigin:mainfrom
MatrixAdventurer:fix/openclaw-episodic-memory-type-20261021
Oct 21, 2026
Merged

loveRhythm1990 merged 1 commit into
matrixorigin:mainfrom
MatrixAdventurer:fix/openclaw-episodic-memory-type-20261021

Conversation

@MatrixAdventurer

Copy link
Copy Markdown
Contributor

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

What type of PR is this?

  • fix (bug fix)
  • test (regression coverage)

What this PR fixes

Memoria core, REST and MCP support six memory types, including episodic, but the OpenClaw plugin's canonical MEMORIA_MEMORY_TYPES list and static plugin manifest omitted it. As a result:

  • retrieveMemoryTypes: ["episodic"] is rejected during plugin config parsing.
  • OpenClaw's published config schema does not advertise the valid value.
  • The same shared runtime enum also prevents OpenClaw tools from accepting episodic where a memory type is selected.

Searches for OpenClaw/episodic, MEMORIA_MEMORY_TYPES, and retrieveMemoryTypes found no duplicate issue or fix PR.

Change

Add episodic to the shared OpenClaw memory-type enum and the checked-in plugin manifest, with regression coverage for both runtime parsing and manifest advertisement.

Scope: 3 files, +21/-1, based on main@0695ad61eec9104478f05f5824b75bdbeeca5616. No API, storage, auth, dependency, or workflow changes. The repository has no dev branch, so this PR targets main.

Verification

Node 24.19.0 / Vitest 4.1.11, from plugins/openclaw:

  • Regression on unchanged main: 2 failed / 19 passed.
  • Focused fixed config suite: 21/21 passed.
  • Full npm test: 205/205 passed across 12 files.
  • npm run test:pack: passed (bundle build, package validation, 6 packed files).
  • git diff --check: passed.
  • Independent review agent: Approve, with focused/full tests and package verification repeated.

Rust tests were not rerun locally because Cargo is unavailable. The patch is additive and directly matches the authoritative Rust core enum and existing MCP schemas, which already include episodic. Upstream required CI remains authoritative.

No merge, deployment, or package publication was performed.

OpenClaw omitted the core-supported episodic memory type from both
runtime validation and the static plugin manifest. Add it to the shared
type list and cover parser/manifest parity with regression tests.

由 LW 授权的 ChatGPT Business 智能体提交。
@loveRhythm1990

Copy link
Copy Markdown
Collaborator

Code review: LGTM on 167e014d58b8fe401431aad8525517e9e546f96f.

The omission is real: Rust's canonical memory-type enum already includes episodic, while the OpenClaw shared enum and manifest reject or omit it. Adding it in both places correctly updates config validation, the derived TypeScript type, and tool schemas/validation that consume the shared enum.

Locally, all 205 OpenClaw tests and package build/verification passed. With the baseline config and manifest, the same config suite produced 2 failures and 19 passes. OpenClaw and Rust/MatrixOne CI passed, including the explicit restore/cleanup regressions. Coverage: 3/3 changed files reviewed (100%), 0 skipped; no actionable code issues found.

There is a separate merge-queue configuration failure: Mergify reports that queue_rules[0].autoqueue is not permitted. This PR does not modify that configuration, so this is not evidence of a regression from the enum change, but the repository-level check still needs to be resolved before relying on the merge queue. No local database integration run is claimed.

@loveRhythm1990

Copy link
Copy Markdown
Collaborator

Non-blocking follow-up (medium severity, pre-existing): accepting retrieveMemoryTypes does not currently make retrieval honor that filter.

The enum/manifest addition is correct. I additionally exercised the registered memory_store and memory_list tools: both now accept episodic, and storing/list filtering work as expected. However, MemoriaClient.retrieve() accepts memoryTypes but omits it from its tool arguments (plugins/openclaw/openclaw/client.ts:387-391); the HTTP adapter also omits it from the request body (http-client.ts:122-128). The REST API already supports RetrieveRequest.memory_types.

Using the actual registered memory_retrieve tool and a loopback fixture that honors memory_types, configuring retrieveMemoryTypes: ["episodic"] still sends no memory_types field and returns both episodic and semantic records. A semantic-only configuration fails the same check, including on the unchanged baseline. The four additional public-tool checks therefore had two passes (store/list) and two failures (retrieval filters). Auto-recall uses the same client retrieval path.

This is an existing wiring defect, not a regression introduced by adding the enum member, so it can be handled separately. Please forward the selected types through both client and transport to the server's memory_types field, with request/result regression tests. The current PR fixes configuration/schema acceptance; it should not be taken as verification that episodic-only retrieval is enforced.

Review coverage remains 3/3 changed files, 0 skipped; the finding above is in unchanged surrounding code.

@aptend aptend left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent deep review of exact head 167e014d58b8fe401431aad8525517e9e546f96f, base/merge-base 0695ad61eec9104478f05f5824b75bdbeeca5616. Read all three changed files, the historical review/discussion and surrounding config/tool/client/server consumers; no inline threads.

No blocking finding in this additive configuration/schema fix. The shared enum and checked-in manifest now agree with Rust's canonical six-type enum, including serialization/parse spelling episodic. The derived TypeScript type, runtime configuration validation, store/list tool schemas and validators, and initialized type counts consume the same shared list. No API/storage/auth/lifecycle change is introduced.

I independently confirmed the already-reported, unchanged retrieval-filter wiring gap: retrieve(memoryTypes) does not forward it, in both this head and base; the HTTP adapter also omits it. That is not caused or fixed by this enum addition. Approval covers accepting/advertising the valid type, not enforcement of episodic-only retrieval; no duplicate follow-up finding is being presented as a new regression.

Verified exact-head CI run 39507121400, job 118918724996, raw output on Node22.23.3: config suite21/21 and complete OpenClaw suite205/205 across12files PASS; bundle/package validation and all6 packed files PASS. git diff --check PASS. Reused qualified CI; no local npm install, database run, product edit or temporary probe claimed.

Copy link
Copy Markdown
Contributor Author

Follow-up implemented in #350: retrieve(memoryTypes) now forwards memory_types through the client and HTTP transport while preserving the omitted-filter request shape.

Validation on the exact published tree: baseline regression 1 failed / 5 passed; fixed focused suite 6/6, full OpenClaw suite 216/216, package validation and all 6 packed files passed, git diff --check passed, and independent review returned APPROVE. The new PR is assigned to and requests review from XuPeng-SH; no merge or deployment action was taken.

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

@loveRhythm1990
loveRhythm1990 merged commit ae3a2e2 into matrixorigin:main Oct 21, 2026
5 of 6 checks passed
loveRhythm1990 pushed a commit that referenced this pull request Oct 21, 2026
## What type of PR is this?

- [x] fix (bug fix)

## Which issue(s) this PR fixes

Follow-up to the pre-existing retrieval wiring defect documented during
review of #347:
#347 (comment)

## What this PR does / why we need it

OpenClaw accepts `retrieveMemoryTypes` and `MemoriaClient.retrieve()`
already exposes `memoryTypes`, but the selected values were dropped
before the request reached the REST API. As a result, configured type
filters could silently retrieve semantic/profile/etc. records together
instead of restricting recall.

This change:
- forwards `memoryTypes` as `memory_types` from the client;
- includes `memory_types` in the HTTP request body only when supplied;
- preserves the existing omitted-filter request shape.

The REST API already supports `RetrieveRequest.memory_types`. No server,
storage, authentication, cache, or response parsing behavior changes.

Scope: **3 files, +20/-0**. Base:
`659a7779c1f3be787c4dba1d67cd12b998dd0b32`. Published commit:
`ccb126290fcfbff1aefb323b0a1d40c2feb22fbb`. Tested/reviewed tree:
`63a8d65e5bea6d830199cda6161fdce0fa7fcebc`.

## Reproduction and validation

The identical regression test was run on current `main` and the fixed
tree:

- Current `main`: **1 failed / 5 passed**; the serialized body lacked
`memory_types`.
- Fixed focused suite: **6/6 passed**.
- Full OpenClaw suite: **216/216 passed across 13 files**.
- `npm run test:pack`: build/package validation passed; all **6 packed
files** verified.
- `git diff --check`: passed.

Independent review agent: **APPROVE**, no blocking findings. It
independently reran the focused suite, all 216 tests, package
validation, and diff check against the exact tested tree. The remote
commit above has that same tree.

Remote Rust/MatrixOne and PR workflow checks are left to CI; no merge or
deployment action is requested.

由 LW 授权的 ChatGPT Business 智能体提交。
loveRhythm1990 added a commit that referenced this pull request Oct 21, 2026
## What type of PR is this?

- [x] build / ci (build or CI changes)

## What this PR does / why we need it

**Behavior change: this proposal restores valid configuration, but does
not restore automatic enqueueing with the currently reported product
settings. Maintainers would use `@mergifyio queue`. The enqueueing
policy needs a maintainer decision before merge.**

Remove rejected `queue_rules[].autoqueue` and migrate
`commit_message_template` to `commit_message_format`. Keep one approval,
no `do-not-merge`, and `base=main` as queue-level conditions. Squash
merging, timeout, concurrency, and GitHub branch protection remain
unchanged. Approver attribution becomes standard `Approved-by` trailers.

Related: #285; configuration failures on #347, #348, and #350.

## Enqueueing decision

- **Automatic:** enable Merge Protections in the dashboard, then
explicitly configure a conditional list (not unconditional `true`):

  ```yaml
  merge_protections_settings:
    auto_merge_conditions:
      - "#approved-reviews-by>=1"
      - label!=do-not-merge
      - base=main
  ```

This is an alternative, not included in the patch. Once `autoqueue` is
removed, do not rely on the bot to migrate that field automatically.
- **Manual:** accept this proposal and use `@mergifyio queue` for
eligible PRs.

The live configuration check confirms Workflow Automation is disabled,
so the retained `pull_request_rules` are inactive; this is now
documented inline. The Merge Protections prerequisite comes from the
bot's #285 notice; dashboard settings have not been independently
verified or changed.

## Validation

- Official schema validation, parsed-YAML gate checks, and `git diff
--check` passed.
- Live `Configuration changed` passed on `999ccb4`; the latest commit
only adds comments and parses identically. Latest-head CI is pending.
- No tracked references to the old approver-attribution syntax outside
`.mergify.yml` were found.
- `Mergify Merge Queue` still evaluates main's old configuration until
merge, so its `autoqueue` error is separate from proposed-file
validation.

Only `.mergify.yml` changes. No merge or product-setting changes
performed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants