openclaw - 💡(How to fix) Fix [Bug]: wal-protocol hook: message:received event lacks workspaceDir/agentId, all agent data written to main workspace [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#74956Fetched 2026-05-01 05:39:39
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
2
Timeline (top)
commented ×1mentioned ×1subscribed ×1

Root Cause

Event context comparison:

Event | workspaceDir | agentId command:new/reset | available via context.workspaceDir | available message:received | NOT available | NOT available

The hook handler has no way to derive the correct per-agent workspace path from the message:received event.

Fix Action

Workaround

Disable the wal-protocol hook. Core memory functionality (session-memory, active-memory, memory-wiki) is unaffected.

RAW_BUFFERClick to expand / collapse

[Bug]: wal-protocol hook: message:received event lacks workspaceDir/agentId, all agent data written to main workspace

Bug Description

The wal-protocol hook listens to the message:received event to write per-agent SESSION-STATE.md data. However, the message:received event context only exposes:

  • from
  • content
  • channelId
  • metadata

It does NOT expose workspaceDir or agentId, which are needed to determine which agent workspace to write to.

In contrast, the command:new/reset event DOES expose context.workspaceDir.

Impact

  • All agents WAL data is written to the main agents SESSION-STATE.md
  • Non-main agents SESSION-STATE.md files are never updated
  • The wal-protocol hook cannot function correctly for any non-main agent

Root Cause

Event context comparison:

Event | workspaceDir | agentId command:new/reset | available via context.workspaceDir | available message:received | NOT available | NOT available

The hook handler has no way to derive the correct per-agent workspace path from the message:received event.

Expected Fix

The message:received event should include workspaceDir and/or agentId in its context (similar to command:new/reset), OR the wal-protocol hook should use an alternative event/hook that provides this information.

Evidence

Hook source: dist/extensions/active-memory/skills/wal-protocol/HOOK.md

The hook listens to message:received but has no way to get workspaceDir:

const eventContext = { from, content, channelId, metadata }; // no workspaceDir

Official docs reference: https://docs.openclaw.ai/automation/hooks

  • command:new/reset: has context.workspaceDir
  • message:received: only has from, content, channelId, metadata

Workaround

Disable the wal-protocol hook. Core memory functionality (session-memory, active-memory, memory-wiki) is unaffected.

Environment

  • OpenClaw: 2026.4.27 (stable)
  • Platform: Windows_NT 10.0.26200
  • Node: v24.14.0
  • Channel: Feishu

extent analysis

TL;DR

Modify the wal-protocol hook to use an alternative event that provides workspaceDir and agentId, or update the message:received event to include these parameters.

Guidance

  • Review the official OpenClaw documentation to explore alternative events that may provide the necessary workspaceDir and agentId parameters.
  • Investigate modifying the wal-protocol hook to listen to the command:new/reset event, which already exposes the required context.workspaceDir.
  • Consider reaching out to the OpenClaw community or support team to request an update to the message:received event to include workspaceDir and agentId.
  • As a temporary workaround, disable the wal-protocol hook to prevent incorrect data writing, as core memory functionality remains unaffected.

Example

No code snippet is provided due to the lack of specific implementation details in the issue.

Notes

The provided solution assumes that an alternative event or modification to the existing event is feasible. Further investigation into the OpenClaw API and documentation is necessary to determine the best approach.

Recommendation

Apply workaround: Disable the wal-protocol hook until a more permanent solution can be implemented, as this prevents incorrect data writing without affecting core memory functionality.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING