Skip to content

fix(openclaw): pin memory tools to the calling agent (WALM-710) - #1027

Open
ducnmm wants to merge 1 commit into
devfrom
henrynguyen/walm-710-bug-openclaw-memory_search-memory_store-ignore-the-calling
Open

ducnmm wants to merge 1 commit into
devfrom
henrynguyen/walm-710-bug-openclaw-memory_search-memory_store-ignore-the-calling

Conversation

@ducnmm

@ducnmm ducnmm commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

Ticket

WALM-710 — https://linear.app/mysten-labs/issue/WALM-710/bug-openclaw-memory-search-memory-store-ignore-the-calling-agent-per
GH #1017 — #1017

What changed?

  • memory_search and memory_store register as OpenClaw tool factories and take the namespace from ctx.sessionKey via resolveAgent.
  • An omitted namespace uses that agent. A model-supplied namespace is rejected unless it is that agent's namespace or its legacy namespace.
  • A main session (no key, or agent:main:) still uses defaultNamespace.
  • The recall hook no longer tells the model to pass namespace.
  • Changelog note is under the existing OpenClaw 0.0.7. No version bump (dev is already ahead of main).

Why is this needed?

The tools trusted the model's namespace argument and fell back to the main agent's memory. A sub-agent that omitted it, or was told to pass default, could read and write the main namespace. The hooks already scoped by session. The tools did not.

Scope

Pin the two agent tools to the calling agent's namespace.

Out of scope

No allowlist of extra namespaces. Hooks still derive the namespace the same way. No relayer change.

How was this tested?

  • Unit tests
  • Integration tests
  • End-to-end tests
  • Manual testing
  • Not applicable

Commands: pnpm --filter @mysten-incubation/oc-memwal test (32 passed). node scripts/verify-manual-sdk-release.mjs passed.

How can the reviewer verify it?

  1. Session agent:support-bot:..., memory_search with no namespace recalls support-bot, not default.
  2. The same session with namespace: "default" returns namespace_rejected and does not call the client.
  3. agent:main: or a missing session key still uses defaultNamespace when namespace is omitted.
  4. agent:Researcher:... may pass Researcher (legacy) and otherwise uses researcher.

Risks and dependencies

Agents that relied on the model passing another namespace will now be rejected. That is the isolation fix. OpenClaw must call the tool factory with the session context (openclaw@2026.9.6).

Author checklist

  • This pull request maps to one ticket and one logical outcome.
  • I reviewed the complete diff myself.
  • I removed unrelated, debug, and temporary changes.
  • I ran the relevant tests.
  • CI is green.
  • The branch is up to date with its target branch.
  • I added or updated tests where appropriate.
  • I documented any important risk, dependency, rollout, or follow-up.
  • I provided clear verification steps.
  • The pull request is ready for review and is no longer a Draft.

@ducnmm
ducnmm requested a review from HoangDucBach September 25, 2026 07:43

This branch has not been deployed

No deployments
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.

1 participant