Every task on an upgraded host failed with
reuse execution environment: execenv: preparation helper failed:
exit status 1: decode preparation request: json: unknown field "HandoffNote"
The preparation helper is spawned from the running daemon's executable
path, so parent and helper are the same program but not necessarily the
same build: every upgrade path replaces that file under a live daemon.
Desktop swaps the bundled/managed CLI and defers the restart while the
daemon is busy; brew and manual replacements are picked up by
trySelfReload only on its next idle tick. Until the daemon re-execs, an
older parent talks to a newer helper.
decodePreparationRequest ran DisallowUnknownFields, which turned that
ordinary window into a hard failure of every task on the host. Removing
TaskContextForEnv.HandoffNote (#7626) was enough to trigger it: the field
was untagged and had no omitempty, so installed daemons kept sending
"HandoffNote": "" and the new helper refused the whole request.
The request is now decoded on the same best-effort terms as the response
the parent already reads back — a param the other side does not know
about is dropped, not fatal. Strictness bought nothing here: parent and
helper are both this package, and the shape is pinned by its own tests.
Co-authored-by: J <[email protected]>
Co-authored-by: multica-agent <[email protected]>
Fixes#7112.
Task preparation ran `openclaw config file` and `config get agents.list --json` with a hardcoded 5s deadline; on a 2020 Intel MacBook Pro those take 8.4-10.9s and 4.3s every time, so the OpenClaw runtime was unusable there with no way to raise the limit.
- Deadline 5s -> 30s, overridable via MULTICA_OPENCLAW_CLI_TIMEOUT / backends.openclaw.cli_timeout, clamped to [1s, 60s] so the worst case (4 serial calls) stays inside the 5-minute preparation budget.
- Config discovery cached per daemon profile (on disk, since preparation runs in a one-shot helper process), invalidated by binary identity, OpenClaw path env, active config stat, and a 60s TTL. Only complete successes are cached; any cache fault degrades to a live CLI run.
- The timeout is classified structurally into a new platform-side, non-retryable reason (runtime_cli_timeout) instead of being text-matched into agent_error.provider_network, which showed "check your network" copy and auto-retried a deterministic local failure. Copy added for web/desktop/mobile; a NormalizeDaemonReason shim upgrades reports from older daemons.
* fix(daemon): bound pre-start task preparation
Co-authored-by: multica-agent <[email protected]>
* fix(daemon): isolate pre-start env preparation
Run execution-environment Prepare and Reuse in a killable helper process so a timed-out attempt cannot keep writing after retry. Add FIFO lifecycle and squad Stage retry regression coverage.
Co-authored-by: multica-agent <[email protected]>
* fix(daemon): terminate Windows prepare process trees
Assign the pre-start helper to a kill-on-close Job Object before releasing its request, wait for all job members to exit on cancellation, and add a Windows runtime regression job.
Co-authored-by: multica-agent <[email protected]>
* ci: target Windows prepare tree regression
Co-authored-by: multica-agent <[email protected]>
---------
Co-authored-by: Bohan-J <[email protected]>
Co-authored-by: multica-agent <[email protected]>