openclaw - 💡(How to fix) Fix 异步命令完成通知广播到所有 session 导致 heartbeat 产生奇怪回复 [1 comments, 2 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#72155Fetched 2026-04-27 05:34:03
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Author
Timeline (top)
closed ×1commented ×1
RAW_BUFFERClick to expand / collapse

问题描述

当异步命令完成时,系统发送的通知("An async command you ran earlier has completed")会被广播到所有活跃的 session,包括当时正在运行的 heartbeat session。

然而,heartbeat session 并没有执行过那个命令,它的上下文中看不到命令输出内容,所以它会回复: "我没有在当前上下文中看到具体的命令输出内容...请问您之前运行的是什么命令?"

这会导致用户看到奇怪的、不相关的消息。

根因分析

从日志分析(session 2cdbcefb-bf25-476d-be76-3d7668e747e1):

  1. 用户在主 session 发送新闻报告,触发了异步命令
  2. 命令完成后,系统发送完成通知
  3. 该通知被发送到了所有活跃 session(包括 heartbeat)
  4. heartbeat session 没有命令上下文,所以产生困惑回复

建议修复

异步命令完成通知应该只发送给发起命令的 session,不应该广播到 heartbeat 或其他 session。

可能的实现方式:

  • 在 async exec 启动时记录发起 session 的 sessionKey
  • 命令完成时只向该 sessionKey 发送通知

环境

  • OpenClaw 版本:2026.4.26
  • Agent:himeko
  • 受影响 session:heartbeat cron session

extent analysis

TL;DR

Only send async command completion notifications to the session that initiated the command.

Guidance

  • Identify the session that initiated the async command and store its sessionKey when the command starts.
  • Modify the notification system to only send completion notifications to the session with the stored sessionKey.
  • Review the current implementation of async command execution and notification to ensure it can be modified to support session-specific notifications.
  • Consider adding logging to track which sessions receive notifications to verify the fix.

Example

No code example is provided as the issue does not include specific implementation details.

Notes

This solution assumes that the async command execution and notification systems can be modified to support session-specific notifications. The feasibility of this solution may depend on the specific implementation of these systems in the OpenClaw version 2026.4.26.

Recommendation

Apply workaround: Modify the notification system to only send completion notifications to the session that initiated the async command, as this directly addresses the identified issue and does not require waiting for a potential fix in a future version.

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 异步命令完成通知广播到所有 session 导致 heartbeat 产生奇怪回复 [1 comments, 2 participants]