openclaw - 💡(How to fix) Fix message tool: 'Invalid session key' on proactive sends to Zulip stream topics (2026.4.1) [1 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#59762Fetched 2026-04-08 02:40:52
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0

The message tool fails with Invalid session key on all proactive sends to Zulip streams. Normal conversation replies work fine. This affects automated sends from heartbeat scripts, watchdog alerts, and any agent-initiated message tool call.

Error Message

The message tool constructs session key agent:main:zulip:channel:desert power from the target parameter. This key IS present in sessions.json with a valid sessionId UUID. However, resolveSessionFilePath throws (caught by the try/catch at gateway-cli line 17921), returning null and triggering the Invalid session key error response.

  • Log entry immediately before error: session maintenance would evict active session; skipping enforcement — possibly related?

Root Cause

The message tool constructs session key agent:main:zulip:channel:desert power from the target parameter. This key IS present in sessions.json with a valid sessionId UUID. However, resolveSessionFilePath throws (caught by the try/catch at gateway-cli line 17921), returning null and triggering the Invalid session key error response.

sessions.json entry for the key:

{
  "sessionId": "<uuid>",
  "chatType": "channel",
  "channel": "zulip",
  "groupId": "stream:desert power"
}

The session file (<uuid>.jsonl) exists on disk and is readable. The failure appears to be inside resolveSessionFilePath itself despite the file being present.

Fix Action

Workaround

None found. The delivery queue accumulates indefinitely.

Code Example

{ "action": "send", "channel": "zulip", "target": "stream:Desert Power:Command Center", "message": "test" }

---

{
  "sessionId": "<uuid>",
  "chatType": "channel",
  "channel": "zulip",
  "groupId": "stream:desert power"
}
RAW_BUFFERClick to expand / collapse

Bug Report

OpenClaw version: 2026.4.1 (da64a97) Channel plugin: Zulip (custom, loaded via plugins.load.paths) OS: Linux 6.8.0-107-generic (x64)

Summary

The message tool fails with Invalid session key on all proactive sends to Zulip streams. Normal conversation replies work fine. This affects automated sends from heartbeat scripts, watchdog alerts, and any agent-initiated message tool call.

Steps to Reproduce

  1. Configure OpenClaw with a Zulip channel plugin
  2. Have an active session in a Zulip stream (e.g. Desert Power > Command Center)
  3. Attempt a proactive send via the message tool:
    { "action": "send", "channel": "zulip", "target": "stream:Desert Power:Command Center", "message": "test" }
  4. Observe: [tools] message failed: Invalid session key

Root Cause Analysis

The message tool constructs session key agent:main:zulip:channel:desert power from the target parameter. This key IS present in sessions.json with a valid sessionId UUID. However, resolveSessionFilePath throws (caught by the try/catch at gateway-cli line 17921), returning null and triggering the Invalid session key error response.

sessions.json entry for the key:

{
  "sessionId": "<uuid>",
  "chatType": "channel",
  "channel": "zulip",
  "groupId": "stream:desert power"
}

The session file (<uuid>.jsonl) exists on disk and is readable. The failure appears to be inside resolveSessionFilePath itself despite the file being present.

Impact

  • ✅ Conversation replies work (use active session correctly)
  • ❌ All proactive message tool sends fail
  • ❌ Delivery queue accumulates and never drains
  • ❌ Heartbeat alerts, watchdog notifications, scheduled sends all broken

Both affected systems upgraded from 2026.3.31 → 2026.4.1 today; the issue appears to be a regression in 2026.4.1.

Workaround

None found. The delivery queue accumulates indefinitely.

Additional Context

  • Two separate OpenClaw instances (different user accounts on same host) both exhibit identical behavior
  • openclaw status shows gateway healthy, Zulip probe ok=true
  • Log entry immediately before error: session maintenance would evict active session; skipping enforcement — possibly related?

extent analysis

TL;DR

The most likely fix involves investigating and resolving the issue with the resolveSessionFilePath function, which is returning null despite the session file being present.

Guidance

  • Investigate the resolveSessionFilePath function to determine why it's returning null for the existing session file.
  • Verify that the file path construction in resolveSessionFilePath matches the actual file path of the session file on disk.
  • Check for any recent changes in the resolveSessionFilePath function or related code that may have introduced this regression in version 2026.4.1.
  • Consider temporarily modifying the resolveSessionFilePath function to log more detailed debugging information to help identify the issue.

Example

No code snippet is provided as the issue requires further investigation into the resolveSessionFilePath function.

Notes

The issue appears to be a regression in version 2026.4.1, and the resolveSessionFilePath function is the likely cause. However, without more information about the function's implementation, it's difficult to provide a specific fix.

Recommendation

Apply a workaround by modifying the resolveSessionFilePath function to correctly resolve the session file path, or revert to a previous version of OpenClaw that does not exhibit this issue, if possible.

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