Fix openclaw agent task with background tool hang#363
Open
jayhenry wants to merge 1 commit into
Open
Conversation
…eceived to ensure robust interaction with the OpenClaw tool.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Openclaw 2026.4.20 在特定任务上会碰到下面的hang住问题。
典型任务是
install-windows-3.11这个 task 本身要求 VM 留在后台运行,所以 agent 确实调用了多次 exec(..., background=true),例如:
原始失败快照里也能看到:
所以结论是:install-windows-3.11 的 client_cli chat 不退出,也是因为 OpenClaw final 后仍保留了后台 exec/process session。后台 QEMU/nginx 是任务预期,但 OpenClaw CLI 在 headless 场景不应该因此阻塞退出。我们现在的 adapter 修复就是:看到 OpenClaw final JSON 后,主动结束 OpenClaw CLI
进程组,让 client_cli chat 写出 response 和 rc。