Skip to content

Bug: message(action="read") fails in isolated/cron sessions — webchat channel scopes tool enum to ["send"] only #20995

@delmarolivier

Description

@delmarolivier

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.jsresolveMessageToolSchemaActions (~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.tsresolveMessageToolSchemaActions

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 20

Impact

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

  1. Create an isolated cron session (any agent heartbeat)
  2. Call message(action="read", channel="slack", target="channel:CHANNEL_ID")
  3. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions