Maintain the canonical live OpenClaw main checkout, macOS LaunchAgent-managed Gateway, local macOS app, exact-head main CI, and recurring full release validatio
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-openclaw-live-updater-fa5aa9beb8d0 ,按照其中的说明把「openclaw-live-updater」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Keep one operator-selected canonical live checkout as a read-only-to-the-agent deployment mirror: clean, standalone, full, on main, and fast-forwarded only. Make every repair in the controlling Codex project worktree.
scripts/pr.launchctl submit or create an ad-hoc KeepAlive job to run updates or Gateway lifecycle commands. A submitted job can relaunch openclaw gateway restart after every exit and cause a persistent restart storm, even without a plist (#114967).Run the deterministic updater and retain its JSON:
cd "<canonical-live-checkout>"
node --import tsx .agents/skills/openclaw-live-updater/scripts/update-main.mjs
The helper owns the current working directory by default; it does not search parent directories or infer a clone from the user's home directory. From a controlling worktree, pass the canonical mirror explicitly with --checkout "<canonical-live-checkout>". Stop on any failed invariant. Do not repair the mirror destructively. The helper holds one checkout-scoped lock across update, build, Gateway proof, and Mac work. A concurrent heartbeat returns reason: "overlap"; it must not start another build. A dead owner lock may be recovered, but unreadable or unsafe lock state fails closed. Linux systemd managed Gateways are outside this helper. It refuses before Git mutation with unsupported_gateway_control_platform and leaves operators on the standard update CLI from openclaw-update.
The helper verifies one unrewritten expected origin, an owned non-symlinked standalone/full clone, single worktree, clean main, fetches origin/main, rechecks for concurrent changes, and merges --ff-only. It then uses the source runner's canonical local-build metadata contract and parser: both dist/.buildstamp and dist/.runtime-postbuildstamp heads, required runtime-postbuild outputs, dist/entry.js, Control UI index plus referenced local assets, and dist/build-info.json must all match exact afterSha.
actions.gatewayBuild and rebuilds exact new main before any restart.node_modules, or missing/invalid build provenance requires pnpm install --frozen-lockfile. When a build is required, do not install before acquiring the maintenance suspension and stopping the managed Gateway.gateway.suspend.prepare, binding both prepare and resume to this checkout's managed LaunchAgent loopback port and service auth even when normal CLI configuration points at a remote Gateway. The LaunchAgent may execute either this checkout's dist/index.js or a clean detached canonical snapshot under ~/.openclaw/runtime/gateway-<sha> whose commit is an ancestor of the checkout; reject every other entrypoint. Never execute snapshot code: capture an exact source control build before the Git fast-forward for its prepare and failure-resume calls, preserve any validated generated service-environment wrapper, and stop the managed LaunchAgent with native launchd bootout. If that control build is missing, first accept native proof that the snapshot job is already booted out with its port free; when the isolated snapshot is still running, build the verified clean source checkout to obtain an exact suspension client, then use only that source client for prepare and failure-resume. Never use this recovery build while launchd targets the source checkout. This atomically pauses cron scheduling, closes new work admission, and refuses while active work remains. A busy result defers further mutation to the next heartbeat; never replace this fence with cron list polling. Once ready, stop directly without a source launcher, install frozen dependencies when required, then build unless the exact recovery build already produced the deployment artifact; source launchers can auto-build stale output before dispatching the stop. Every external phase has a wall-clock budget: Git fetch 5 minutes, Git merge 2 minutes, dependency install 15 minutes, Gateway build 20 minutes, service control 60 seconds, probes 30 seconds, and Mac rebuild 30 minutes. Progress output never extends a budget. A timeout must drain the task-owned process tree before rollback, previous-service bootstrap, lock release, or the final JSON result. If POSIX cleanup cannot prove the process group gone, skip service recovery, retain the maintenance lock against that process group, and emit ; after an operator terminates the group, the next heartbeat reclaims the stale lock. Resume the suspension if stop fails. If suspension RPC is unavailable on macOS, proceed only when native inspection proves this checkout's managed LaunchAgent is booted out and its configured port has no listener; never accept a loaded KeepAlive job's transient stopped state. On non-macOS hosts refuse before Git mutation with and leave operators on the standard update CLI. Never treat a Linux systemd Gateway as this helper's stop-proof path. This preserves retry after a post-stop failure without weakening the live-work fence. Preserve outside for the build and restore it even when the build fails, because the JS build cleans regardless of Mac impact classification. Never mutate the live tree while an old Gateway can dynamically import from it. must leave both canonical stamp heads and equal to post-update ; any missing/mismatched stamp or required artifact blocks restart.If changed paths can affect macOS, the helper runs scripts/restart-mac.sh --sign --wait --target-only with SKIP_TSC=1 and SKIP_UI_BUILD=1 only after the exact-SHA JS/UI build completes. Reusing those artifacts keeps the live app bundle out of any later JavaScript build cleanup. Target-only mode may stop the canonical /Applications/OpenClaw.app process and this checkout's exact dist process before launching the rebuilt dist app. It defers when another worktree, temporary bundle, test, or agent-owned OpenClaw process is active; it never kills that process. The script's immediate OK is not proof. The helper waits and requires the exact executable <canonical-live-checkout>/dist/OpenClaw.app/Contents/MacOS/OpenClaw, derived from the verified checkout, then repeats Gateway RPC and health proof.
Never kill another worktree, temporary bundle, test, or agent-owned OpenClaw process. If a foreign app prevents the exact target from staying alive, record the pending Mac attempt, report it, and retry on the next heartbeat. Escalate only after the conflict persists across repeated heartbeats; never claim Mac proof from another bundle or the short launch check. If actions.macUiVerification is true, exercise the changed behavior with the existing macOS/UI automation workflow after delayed exact-bundle proof.
Load $openclaw-testing. Resolve exact current origin/main, then inspect only relevant required checks and workflow jobs whose headSha equals it. Ignore skipped jobs and routine noise such as Auto response, Labeler, docs agents, performance advisory jobs, and stale/cancelled runs superseded by a newer run for the same SHA.
For an attributable failure, leave the mirror untouched. Use the controlling Codex worktree, trace the failed surface, add focused proof, run $autoreview, open a focused PR, and land through $openclaw-pr-maintainer's exact scripts/pr sequence. Never weaken or bypass the failing gate. After landing, begin again at step 1 so the mirror, Gateway, app classification, and exact-head checks all converge on new main.
If no update, build repair, pending Mac retry, or exact-head failure exists, report a terse no-op with the SHA and proof checked.
Load $release-openclaw-ci and $openclaw-testing. This is validation only, never release preparation or publication.
Treat 12 hours as wall-clock cadence, not per-SHA cadence. Inspect Full Release Validation runs from the last 12 hours and verify effective release_profile=full, rerun_group=all, and expected child-job shape. Any valid active or successful full/all umbrella in that window satisfies the cadence even if main advanced afterward. Never duplicate an active full/all run. The scheduled Full Release Validation Nightly (04:00 UTC, stable profile, main-qualification) is additional stable-profile evidence and never satisfies this full/all cadence; when both target the same SHA, the full sweep still runs and may adopt the nightly's per-child receipts.
Only when the cadence is due, confirm no full/all run is active, then snapshot exact current origin/main after checking mirror invariants. Run the provider-secret preflight without printing secrets and dispatch the trusted workflow once:
MAIN_SHA="<exact-main-sha>"
pnpm ci:full-release \
-f validation_purpose=main-qualification \
--sha "$MAIN_SHA" \
--workflow-sha "$MAIN_SHA" \
-f provider=openai \
-f mode=both \
-f release_profile=full \
-f rerun_group=all
Let the helper watch the parent to terminal and verify its release evidence. Retain its parent URL and require the recorded target SHA and children to match the dispatch snapshot. Fetch logs only for failed or blocking jobs. Do not cancel unrelated release checks.
For a code or harness failure, repair and land from the Codex worktree as above. Then invoke the same helper with a new frozen exact-main tuple and the narrowest supported rerun_group that covers the failed child; use live_suite_filter for one live/E2E shard. A targeted recovery run does not create a second full/all cadence dispatch.
Report exact SHA, parent and child run URLs/IDs, conclusions, repairs and landed PRs, targeted reruns, and any genuine proof gap. Do not write release evidence or publish artifacts unless separately authorized.
CHANGELOG.md change.main, the Codex worktree clean on the expected branch, remote Testbox stopped, and every public GitHub write linked in the controlling thread.command_timeoutcommand_cleanup_failedunsupported_gateway_control_platformdist/OpenClaw.appdistdistdistpnpm builddist/build-info.json.commitafterShagateway status --deep --require-rpc --json plus health --verbose --json. A validated ancestor snapshot is suspension-only: prove the old launchd job is booted out with its port free, allowing bounded retries while launchd and the listener finish teardown, then atomically retarget only the owned LaunchAgent entrypoint to this checkout's exact dist/index.js, including on a retry where the build is already current. Replace the verified ProgramArguments array as one value; never use array-index plist mutation that can insert a duplicate argument. Preserve all other service arguments and environment unchanged. After restart, prove the loaded launchd PID owns the configured listener.Treat supervisor state alone as insufficient. If build or proof fails, leave the new mirror head intact and retry the stale/missing build on the next heartbeat; never run the old dist against new source.
Keep the deterministic helper as the only update/restart owner: acquire its maintenance suspension fence, complete the update and exact-SHA build, restart the managed LaunchAgent through that helper, and verify with status and health. Leave only the managed Gateway LaunchAgent responsible for its lifecycle. gateway status and doctor report foreign ai.openclaw.* jobs; report any such job instead of creating another update job or manually removing a job whose ownership is uncertain. doctor --fix can remove confirmed stray lifecycle jobs when separately authorized; it is not a substitute for the suspension fence.
Re-run the canonical freshness check immediately before every pnpm openclaw restart or probe so the source runner cannot hide stale output with an implicit auto-build. Every pass, including a no-update/current-build pass, must run deep RPC status and verbose health. If that first probe fails while the build is already exact-current, perform one managed Gateway restart and repeat both probes once. Do not rebuild a current exact-SHA artifact merely to self-heal the managed process; fail and diagnose if the one restart does not recover it.