← Back to library

CLI 发送后卡死修复:消息已送达但进程不退出的治理流程

用于“`openclaw message send` 已发送成功但脚本一直挂住”场景。前置:有自动化脚本调用 CLI 且存在超时重试。步骤:升级到含 PR #16491→验证成功路径会 `exit(0)`→压测脚本重试逻辑→去重历史重复发送策略。关键命令:`openclaw message send ...`。验证:发送后进程按预期退出、不再触发重复重试。风险:旧脚本若依赖常驻进程行为需调整。

GITHUBDiscovered 2026-02-15Author yinghaosang
Prerequisites
  • You run OpenClaw CLI in scripts (cron/CI/execSync) and can observe process exit code.
  • At least one channel plugin is configured for `message send` tests.
Steps
  1. Upgrade to a build containing PR #16491.
  2. Run a controlled send command and confirm the process exits immediately after delivery with code 0.
  3. Test failure path (invalid target/channel) and verify non-zero exit is preserved.
  4. Update retry policy to avoid duplicate sends for legacy timeout-based wrappers.
Commands
openclaw message send --channel telegram --target <chat_id> --message "smoke test"
echo $?
Verify

Successful send exits promptly; no hanging process and no duplicate message caused by timeout retries.

Caveats
  • If your wrapper assumes persistent process state, adapt it to one-shot CLI semantics.
  • Channel-side delivery guarantees still depend on provider availability(需验证).
Source attribution

This tip is aggregated from community/public sources and preserved with attribution.

Open original source ↗
Visit original post