openclaw - 💡(How to fix) Fix [Bug]: 异步工具执行结果无法显示在回复中 [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#60082Fetched 2026-04-08 02:36:37
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Participants
Timeline (top)
labeled ×2closed ×1reopened ×1subscribed ×1

当在回复中调用异步工具(如 exec, read 等)时,工具执行成功,但执行结果无法显示给用户。只有工具调用的 JSON 格式被显示,实际结果丢失。

Error Message

[ERROR] Async tool result lost: context cancelled [WARN] Message send failed: channel closed

Root Cause

当在回复中调用异步工具(如 exec, read 等)时,工具执行成功,但执行结果无法显示给用户。只有工具调用的 JSON 格式被显示,实际结果丢失。

Code Example

[ERROR] Async tool result lost: context cancelled
[WARN]  Message send failed: channel closed
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

当在回复中调用异步工具(如 exec, read 等)时,工具执行成功,但执行结果无法显示给用户。只有工具调用的 JSON 格式被显示,实际结果丢失。

Steps to reproduce

1.在对话中要求 AI 执行任何命令,如 openclaw status 2.AI 显示工具调用 JSON,如:{"command": "openclaw status 2>&1"} 3.工具实际执行成功(后台日志确认) 4.问题: 用户看不到执行结果,回复在此处中断

Expected behavior

工具执行结果应该正确显示在回复中,例如: 👶 让我检查系统状态... [工具调用] Status: running Gateway: running ...

Actual behavior

👶 让我检查系统状态... [工具调用]

[然后什么都没有了,结果丢失]

OpenClaw version

OpenClaw 2026.4.2 (d74a122)

Operating system

Alibaba Cloud Linux 3.2104 U12.3 (OpenAnolis Edition)

Install method

No response

Model

kimi/k2p5

Provider / routing chain

WebChat, 飞书 (多渠道均受影响)

Additional provider/model setup details

No response

Logs, screenshots, and evidence

[ERROR] Async tool result lost: context cancelled
[WARN]  Message send failed: channel closed

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

The issue can be fixed by handling the asynchronous tool execution result and ensuring it is properly sent back to the user, potentially by checking the context cancellation and channel closure.

Guidance

  • Verify that the asynchronous tool execution is properly handled and its result is stored or sent back to the user.
  • Check the context cancellation and channel closure errors in the logs to understand why the result is lost.
  • Review the code that handles the tool execution and result sending to ensure it is correct and can handle potential errors.
  • Consider adding error handling and logging to better understand the issue and improve the overall robustness of the system.

Example

No specific code example can be provided without more information about the codebase, but a general approach could involve checking the result of the asynchronous tool execution and handling any potential errors:

try:
    # Execute the tool asynchronously
    result = execute_tool_async()
    # Send the result back to the user
    send_result_to_user(result)
except ContextCancelledError:
    # Handle context cancellation error
    log_error("Context cancelled")
except ChannelClosedError:
    # Handle channel closure error
    log_error("Channel closed")

Notes

The provided logs suggest that the context is cancelled and the channel is closed, which might be the reason for the lost result. However, without more information about the code and the system, it is difficult to provide a more specific solution.

Recommendation

Apply workaround: Handle the asynchronous tool execution result and ensure it is properly sent back to the user, and add error handling to improve the overall robustness of the system. This is because the issue seems to be related to the handling of the tool execution result and the potential errors that occur during this process.

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…

FAQ

Expected behavior

工具执行结果应该正确显示在回复中,例如: 👶 让我检查系统状态... [工具调用] Status: running Gateway: running ...

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING