fix(memory-runtime): classify workspace memory paths so the host keeps MEMORY.md and USER.md in the bootstrap prompt - #1000
Open
gorkem2020 wants to merge 1 commit into
Conversation
gorkem2020
marked this pull request as ready for review
September 16, 2026 06:27
Contributor
Author
|
Ready for review. Deployed on our gateway since 2026-09-16 03:53: the host's |
gorkem2020
force-pushed
the
fix/memory-runtime-provenance-classification
branch
from
September 17, 2026 02:25
cb41638 to
cae758f
Compare
…s MEMORY.md and USER.md in the bootstrap prompt OpenClaw 2026.9.x asks the memory-slot owner for provenance classification before it injects workspace memory files automatically; without classifyWorkspaceMemoryPaths the host reports the runtime as unsupported, logs "excluding automatic memory context" on every session start and drops MEMORY.md and USER.md from the bootstrap prompt. The runtime now classifies paths the way the host's default provider does: curated root files and memory/**/*.md are agent-origin, dream artifacts are system-origin, everything else (and anything outside the workspace) is untrusted.
gorkem2020
force-pushed
the
fix/memory-runtime-provenance-classification
branch
from
September 17, 2026 02:45
cae758f to
bbe154d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On OpenClaw 2026.9.x the host asks the memory-slot owner to classify the provenance of workspace memory files before it injects them automatically (
MemoryPluginRuntime.classifyWorkspaceMemoryPaths, seesrc/plugins/registry-contribution-types.tsandsrc/agents/bootstrap-files.tsin openclaw). memory-lancedb-pro registers a runtime without that method, soclassifyActiveMemoryWorkspacePathsreportsunsupported, the host logson every session start, and treats the bootstrap candidates (
MEMORY.mdandUSER.md) as ineligible. The visible effect is the log line; the real effect is thatMEMORY.mdandUSER.mdsilently drop out of every agent's bootstrap prompt while this plugin holds the memory slot.Fix
The runtime object built by
createOpenClawMemoryCapabilitynow implementsclassifyWorkspaceMemoryPaths. The classification mirrors the host's own default provider (memory-coreworkspace-path-classifierandmemory-path-provenance) without its private provenance sidecar, which is not reachable through the plugin SDK:MEMORY.md,memory.md,USER.mdat the workspace root:agentmemory/**/*.md(the plugin's own journal and reflection outputs live there):agentDREAMS.md,memory/dreaming/**,memory/.dreams/**:systemuntrustedagentis eligible for automatic injection in the host (isMemoryOriginEligibleForAutomaticInjection), soMEMORY.mdandUSER.mdare injected again and the log line stops. Paths are returned in the requested order, verbatim.Tests
test/memory-runtime-provenance-classification.test.mjs(registered in thetestchain and the CI manifest): the runtime exposes the method and keeps both bootstrap candidates eligible; journals and reflections areagent; dream artifacts aresystem; other files, non-markdown files undermemory/, and paths escaping the workspace areuntrusted; order and paths are preserved.npm run buildand the fullnpm testchain pass locally.