Repository navigation
fix(infra): verify managed update handoff startup - #103278
Merged
Merged
Conversation
Co-authored-by: 丁宇婷0668001435 <[email protected]>
Contributor
Author
|
Land-ready proof for exact head
Known proof gap: real launchd and Windows Task Scheduler service-manager E2E were not rerun. Their launch shape is unchanged; focused cross-platform tests and exact-head CI cover those branches, while the dependency-sensitive systemd path was exercised live. |
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 10, 2026
* fix(infra): verify managed update handoff startup Co-authored-by: 丁宇婷0668001435 <[email protected]> * fix(infra): terminate timed-out update handoff --------- Co-authored-by: 丁宇婷0668001435 <[email protected]>
This was referenced Oct 23, 2026
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.
Supersedes #101524. GitHub rejected the contributor fork's far-behind full-tree update, so this replacement keeps the same focused patch on a maintainer branch with the original contributor credited as co-author.
What Problem This Solves
Managed-service updates could crash the live Gateway when the detached handoff process failed to spawn. The original mitigation consumed the asynchronous child-process error, but then incorrectly reported the handoff as started and allowed the Gateway to shut down without a running updater.
This also affected the Linux systemd path: Node starts
systemd-runfirst, while the requested helper is executed only after the user manager accepts the transient scope.Why This Change Was Made
The handoff helper now emits a small readiness marker after loading its private parameter file. The parent waits for that marker before reporting
started, closes the readiness pipe, and then unreferences the detached helper. Direct spawn errors, systemd launcher exits, output errors, and readiness timeouts reject through the existing failed-handoff paths.If startup fails, OpenClaw removes the complete temporary handoff directory so the helper script, parameters, and restart metadata do not remain on disk. RPC and automatic-update callers retain their existing error handling and no longer schedule Gateway shutdown after failure.
User Impact
Managed updates now fail visibly and leave the running Gateway intact when the updater cannot start. Successful launchd, systemd, and Windows handoffs retain detached behavior.
Evidence
errorand successful process creation emitsspawnfirst.src/run/run.c; scope mode completesStartTransientUnitand its start job before replacingsystemd-runwith the requested command.cbx_1089f9628131, runrun_bdad6b34bb5a, passed 124 focused tests.tbx_01kx4v4zx7ecf61amvq5yf9742passed 131 focused Gateway/infra tests and the fullcheck:changedgate.ENOENT; zero new handoff directories remained.startedwith a numeric PID, removed all three sensitive inputs, and retained its normal log.systemd-run --user --scopereached helper readiness and left zero residual test directories.Exact pushed-head CI passed for
f3a13fc10869f7386baf173672694805eace2bdbin run 29065636575, including the required Windows coverage selected by the workflow.Merge Risk
Low-to-moderate and bounded to managed update handoff startup. The readiness wait has a 30-second fail-closed bound; after success the only parent pipe is destroyed before the child is unreferenced. No config, protocol, dependency, or steady-state storage surface changes.
AI-assisted: maintainer repair and validation performed with Codex; contributor credit preserved.