Skip to content

Commit 325679a

Browse files
authored
fix: reuse built control UI for live Mac updates (#104482)
* fix: reuse built control UI for live Mac updates * fix: pin live updater Mac build inputs
1 parent fa77fe1 commit 325679a

3 files changed

Lines changed: 16 additions & 5 deletions

File tree

.agents/skills/openclaw-live-updater/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Keep `/Users/steipete/openclaw` a read-only-to-the-agent deployment mirror: clea
3838

3939
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.
4040

41-
3. If changed paths can affect macOS, the helper runs `scripts/restart-mac.sh --sign --wait --target-only` only after the exact-SHA JS/UI build completes. 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 `/Users/steipete/openclaw/dist/OpenClaw.app/Contents/MacOS/OpenClaw`, then repeats Gateway RPC and health proof.
41+
3. 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 `/Users/steipete/openclaw/dist/OpenClaw.app/Contents/MacOS/OpenClaw`, then repeats Gateway RPC and health proof.
4242

4343
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.
4444

.agents/skills/openclaw-live-updater/scripts/update-main.mjs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -855,9 +855,20 @@ export function maintainMain(options, dependencies = {}) {
855855
};
856856
writeMaintenanceState(statePath, pendingState);
857857
try {
858+
// The exact-SHA JS build above already produced dist/control-ui. Letting
859+
// Mac packaging rebuild it can empty dist while the live app bundle is
860+
// there, defeating the staged-swap guarantee.
858861
runCommand(
859-
"bash",
860-
["scripts/restart-mac.sh", "--sign", "--wait", "--target-only"],
862+
"env",
863+
[
864+
"SKIP_TSC=1",
865+
"SKIP_UI_BUILD=1",
866+
"bash",
867+
"scripts/restart-mac.sh",
868+
"--sign",
869+
"--wait",
870+
"--target-only",
871+
],
861872
update.checkout,
862873
);
863874
const macTarget = verifyMacTarget(update.checkout);

test/scripts/openclaw-live-updater.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ describe("openclaw live updater", () => {
407407
"pnpm openclaw gateway restart",
408408
"pnpm openclaw gateway status --deep --require-rpc --json",
409409
"pnpm openclaw health --verbose --json",
410-
"bash scripts/restart-mac.sh --sign --wait --target-only",
410+
"env SKIP_TSC=1 SKIP_UI_BUILD=1 bash scripts/restart-mac.sh --sign --wait --target-only",
411411
"pnpm openclaw gateway status --deep --require-rpc --json",
412412
"pnpm openclaw health --verbose --json",
413413
]);
@@ -708,7 +708,7 @@ describe("openclaw live updater", () => {
708708
expect(retryCommands.calls.slice(0, 3)).toEqual([
709709
"pnpm openclaw gateway status --deep --require-rpc --json",
710710
"pnpm openclaw health --verbose --json",
711-
"bash scripts/restart-mac.sh --sign --wait --target-only",
711+
"env SKIP_TSC=1 SKIP_UI_BUILD=1 bash scripts/restart-mac.sh --sign --wait --target-only",
712712
]);
713713
expect(existsSync(statePath)).toBe(false);
714714
});

0 commit comments

Comments
 (0)