长任务不再被默认超时杀掉:后台 exec 显式做“无默认超时”校验
问题/场景:过去后台任务(`background: true` 或显式 `yieldMs`)在未设置 timeout 时可能被默认超时终止。前置条件:升级到包含 2026.2.22-beta.1 修复的版本。实施步骤:构造一个超过默认阈值的后台任务,确认不会被默认 timeout 杀死,再按任务 SLA 仅对关键作业设置显式 timeout。关键命令:后台 `exec` + `process poll/log`。验证:长任务持续运行直至自然完成或手动终止。风险与边界:无限运行任务仍需你自己设置预算与回收策略。来源:release fixes(Exec/Background)。
GITHUBDiscovered 2026-02-23Author openclaw
Prerequisites
- You run long-lived background jobs through OpenClaw `exec` + `process`.
- You can safely run a non-destructive long-running test command in your environment.
Steps
- Start a background command expected to run beyond the historical default timeout window.
- Do not set explicit timeout for this test; monitor via `process poll` and `process log`.
- Confirm the session remains alive past previous cutoff and exits only when work completes.
- For production, add explicit timeout only where SLA/risk requires bounded execution.
Commands
# background exec (example): sleep 1200process listprocess poll --sessionId <id>Verify
Background session survives previous default timeout boundary and ends normally with expected output.
Caveats
- Without explicit timeout, runaway commands can consume resources indefinitely.
- Exact prior default timeout differs by runtime/version; baseline data should be captured before/after(需验证).
Source attribution
This tip is aggregated from community/public sources and preserved with attribution.
Open original source ↗