openclaw - 💡(How to fix) Fix [Feature Request] Dispatch agents cannot notify users via Feishu on completion [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#53661Fetched 2026-04-08 01:25:10
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

Error Message

Current behavior: sessions_send to a busy session times out after ~30s and returns an error.

Root Cause

When a dispatch sub-agent (e.g. xiaoma:dispatch:xxx) completes a task and tries to notify the main session or user via sessions_send, it frequently times out because the target session is busy or unresponsive. Additionally, cross-account Feishu messaging via the message tool often fails with 400 errors due to permission restrictions between accounts.

Fix Action

Fix / Workaround

When a dispatch sub-agent (e.g. xiaoma:dispatch:xxx) completes a task and tries to notify the main session or user via sessions_send, it frequently times out because the target session is busy or unresponsive. Additionally, cross-account Feishu messaging via the message tool often fails with 400 errors due to permission restrictions between accounts.

This creates a silent failure problem: the dispatch agent completes its work, the files are saved correctly, but nobody is notified. The user sees no progress and assumes the task was never started.

Current workaround

RAW_BUFFERClick to expand / collapse

Problem

When a dispatch sub-agent (e.g. xiaoma:dispatch:xxx) completes a task and tries to notify the main session or user via sessions_send, it frequently times out because the target session is busy or unresponsive. Additionally, cross-account Feishu messaging via the message tool often fails with 400 errors due to permission restrictions between accounts.

This creates a silent failure problem: the dispatch agent completes its work, the files are saved correctly, but nobody is notified. The user sees no progress and assumes the task was never started.

Current workaround

Add a manual step to every dispatch instruction:

"After completing, run report.sh complete <task> <summary> to send a Feishu message directly to Matt."

This works but:

  • Requires every caller to remember to add the instruction
  • Is invisible to new team members
  • Adds friction to the dispatch workflow

Proposed solutions (in order of preference)

Option 1: Automatic Feishu notification on dispatch completion

When a dispatch agent finishes (stops), OpenClaw should automatically send a completion notification to the user who initiated the dispatch, via the same channel the dispatch was requested on (e.g. Feishu).

This should be:

  • A configuration flag (opt-in, default off)
  • Configurable message format with tokens: {agent}, {task}, {status}, {output_path}

Option 2: Make sessions_send more resilient

Current behavior: sessions_send to a busy session times out after ~30s and returns an error.

Improve: Add a queued delivery mechanism — if the target session is busy, queue the message and deliver when the session becomes available. Notify the user if delivery fails after N minutes.

Option 3: Dispatch-to-Feishu bridge skill

Publish a skill that wraps the dispatch completion logic with automatic Feishu notification. Document it as the standard pattern for all dispatch work in the team.

Use case

Any team using OpenClaw dispatch mode with Feishu, where background agents handle long-running tasks (data processing, web scraping, report generation) and need to notify the user on completion.

Priority

High — this is a silent failure that makes dispatch mode unreliable for production workflows.

extent analysis

Fix Plan

To address the silent failure issue, we will implement Option 1: Automatic Feishu notification on dispatch completion. This involves adding a configuration flag and modifying the dispatch agent to send a completion notification to the user.

Step-by-Step Solution:

  1. Add a configuration flag: Introduce a new configuration option auto_notify_on_completion (default: false) to enable or disable automatic notifications.
  2. Modify the dispatch agent: Update the dispatch agent to send a completion notification when it finishes. Use a templating engine to allow customizable message formats with tokens: {agent}, {task}, {status}, {output_path}.
  3. Implement notification sending: Use the Feishu API to send notifications. Handle errors and retries to ensure reliable delivery.

Example Code (Python):

import os
import requests

# Configuration
auto_notify_on_completion = True
feishu_api_token = "YOUR_FEISHU_API_TOKEN"
feishu_user_id = "USER_ID"

# Dispatch agent completion handler
def on_dispatch_completion(agent, task, status, output_path):
    if auto_notify_on_completion:
        # Prepare notification message
        message = f"Task {task} completed by {agent} with status {status}. Output: {output_path}"
        # Send notification via Feishu API
        send_feishu_notification(feishu_api_token, feishu_user_id, message)

def send_feishu_notification(token, user_id, message):
    url = f"https://open.feishu.cn/open-apis/message/v4/send/"
    headers = {"Authorization": f"Bearer {token}"}
    data = {"receiver_id": user_id, "content": message}
    response = requests.post(url, headers=headers, json=data)
    if response.status_code != 200:
        # Handle error and retry
        print(f"Error sending notification: {response.text}")

# Example usage
on_dispatch_completion("xiaoma:dispatch:xxx", "task-123", "success", "/path/to/output")

Verification

To verify the fix, test the dispatch agent with the auto_notify_on_completion flag enabled. Check that notifications are sent successfully to the user when the dispatch agent completes.

Extra Tips

  • Ensure proper error handling and retries for notification sending to prevent silent failures.
  • Document the new configuration option and notification feature in the OpenClaw documentation.
  • Consider implementing Option 2: Make sessions_send more resilient as a future enhancement to improve overall system reliability.

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

openclaw - 💡(How to fix) Fix [Feature Request] Dispatch agents cannot notify users via Feishu on completion [1 participants]