-
-
Notifications
You must be signed in to change notification settings - Fork 69.4k
Bug: message(action="read") fails in isolated/cron sessions — webchat channel scopes tool enum to ["send"] only #20995
Description
Summary
message(action="read") fails in isolated and cron sessions with:
Validation failed for tool "message": action: must be equal to one of the allowed values
The root cause is a 6-step chain where isolated sessions inherit ctx.Provider = "webchat" (internal channel), causing the message tool's action enum to be scoped to webchat's empty plugin action list — resulting in ["send"] only.
Root Cause
File: dist/pi-embedded-_crSbDV9.js — resolveMessageToolSchemaActions (~line 32600)
Isolated/cron sessions have ctx.Provider = "webchat" (internal channel). This flows to createMessageTool({ currentChannelProvider: "webchat" }). The function hits the if (currentChannel) branch ("webchat" is truthy), calls listChannelSupportedActions({ channel: "webchat" }) — which returns [] because webchat has no plugin. Result: tool enum = ["send"] only.
Main sessions work because ctx.Provider = "slack", which has a full action list including "read".
The Fix
File: src/agents/tools/message-tool.ts — resolveMessageToolSchemaActions
Add a guard so webchat-bound isolated sessions fall through to the full listChannelMessageActions(cfg) instead of being scoped to webchat's empty list:
// BEFORE:
if (currentChannel) {
// AFTER:
if (currentChannel && currentChannel !== INTERNAL_MESSAGE_CHANNEL) {This is safe because listChannelMessageActions(cfg) returns all actions supported by configured plugins, and runtime delivery is still gated by enforceCrossContextPolicy().
Workaround (Until Fix Lands)
Use the CLI via exec instead of the message tool:
openclaw message read --channel slack --target channel:CHANNEL_ID --limit 20Impact
All agents using message(action="read") in isolated/cron sessions are silently failing. In our deployment: 7 agents × heartbeat monitoring = all Slack reads broken in every cron session. Agents were returning HEARTBEAT_OK without actually reading anything.
Steps to Reproduce
- Create an isolated cron session (any agent heartbeat)
- Call
message(action="read", channel="slack", target="channel:CHANNEL_ID") - Observe:
Validation failed for tool "message": action: must be equal to one of the allowed values
Environment
- OpenClaw version: 2026.2.17
- Platform: Kali Linux arm64
- Channel: Slack (socket mode)
- Sessions affected: all isolated / cron sessions
Full Analysis
Detailed findings with full code trace at: workspace/findings/isolated-session-slack-read.md (local, happy to paste inline if needed)