Skip to content

feishu channel: DM messages fail to dispatch — TypeError: Cannot read properties of undefined (reading 'run') #89697

Description

@Nick-730

Bug Report

Environment

  • OpenClaw: 2026.5.28
  • Node: v24.14.0
  • OS: macOS 14.8.5
  • Channel: Feishu (websocket mode)
  • Session dmScope: tested with both per-channel-peer and main

Description

Feishu DM messages are received by the channel but fail to dispatch to the agent runner.

Error

Every Feishu direct message triggers:

feishu[default]: received message from ou_xxx (p2p) ✓
feishu[default]: dispatching to agent (session=agent:main:feishu:direct:ou_xxx) ✓
feishu[default]: failed to dispatch message: TypeError: Cannot read properties of undefined (reading 'run')

What works

  • Messages sent TO Feishu via cron jobs (isolated agentTurn + delivery.announce) work fine
  • WebChat channel works normally
  • Feishu channel status: enabled, configured, running
  • Feishu WebSocket client starts successfully

What doesn't work

  • Any DM sent FROM Feishu to the agent — always fails with the same TypeError
  • Happens with both dmScope=per-channel-peer and dmScope=main
  • The feishu:direct session is created but its transcriptPath is empty and channel/lastRoute are null

Attempted fixes (none worked)

  1. Deleting and recreating the feishu:direct session from sessions.json
  2. Switching dmScope between per-channel-peer and main
  3. Adding model fallbacks (deepseek -> minimax)
  4. Full gateway restart multiple times

Key log pattern (repeated every DM attempt)

feishu[default]: received message from ou_xxx in oc_xxx (p2p)
feishu[default]: Feishu[default] DM from ou_xxx: {message content}
feishu[default]: dispatching to agent (session=agent:main:feishu:direct:ou_xxx)
feishu[default]: failed to dispatch message: TypeError: Cannot read properties of undefined (reading 'run')

Additional observations

The session entry in sessions.json shows:

  • sessionId: generated UUID (valid)
  • transcriptPath: (empty string)
  • channel: null
  • lastRoute: null

This suggests the session object is created but the runner instance is not properly initialized. Agent runner property run is undefined at dispatch time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions