Skip to content

Fix openclaw agent task with background tool hang#363

Open
jayhenry wants to merge 1 commit into
InternLM:v1.0.0from
jayhenry:openclaw_background_hang
Open

Fix openclaw agent task with background tool hang#363
jayhenry wants to merge 1 commit into
InternLM:v1.0.0from
jayhenry:openclaw_background_hang

Conversation

@jayhenry

@jayhenry jayhenry commented Jul 1, 2026

Copy link
Copy Markdown

Openclaw 2026.4.20 在特定任务上会碰到下面的hang住问题。

典型任务是 install-windows-3.11

这个 task 本身要求 VM 留在后台运行,所以 agent 确实调用了多次 exec(..., background=true),例如:

  • 启动 QEMU:background: true
  • 启动 websockify:background: true
  • tool 返回:Command still running (session ..., pid ...). Use process ...

原始失败快照里也能看到:

  • OpenClaw 已在 02:24:51 写出 final,finishReason=stop
  • 但到 02:30:01:
    • client_cli chat 还活着
    • openclaw / openclaw-agent 还活着
    • /tmp/response_message.json 缺失
    • /tmp/xt_entry_agent_chat_*.rc 缺失
    • QEMU/nginx 已在后台运行

所以结论是: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。

…eceived to ensure robust interaction with the OpenClaw tool.
@jayhenry jayhenry changed the title Openclaw background hang Fix openclaw agent with background task hang Jul 1, 2026
@jayhenry jayhenry changed the base branch from main to v1.0.0 July 1, 2026 08:25
@jayhenry jayhenry changed the title Fix openclaw agent with background task hang Fix openclaw agent task with background tool hang Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant