Repository navigation
fix(update): keep argument-error launcher fix at format 4 - #208734
Conversation
- Keep #208068 behavior without preventing older format-4 writers from refreshing the launcher.
|
🦞👀 ClawSweeper review completeClawSweeper finished reviewing this revision. |
|
Codex review: passed. What this changesThis PR restores launcher format 4 while retaining argument-error handling and preserving installed launchers with higher formats. Example: An installation later returns to an older format-4 writer.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep this PR open: it makes a focused compatibility repair without changing the argument-error fix, and source review found no introduced defect. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe update owner writes a resident launcher that starts the selected Gateway release, handles trial recovery, and exchanges lifecycle messages with its child. flowchart TD
A[OpenClaw update] --> B[Launcher writer]
B --> C[Installed launcher]
C --> D[Selected Gateway release]
D --> E[Lifecycle IPC]
E --> C
C --> F[Trial recovery]
Technical reviewBest possible solution: Keep the minimal format-4 correction and existing higher-format preservation without adding another launcher replacement path. Do we have a high-confidence way to reproduce the issue? Source establishes that an older format-4 writer refuses an installed format-5 launcher; no fresh reproduction was executed during this read-only review. Is this the best way to solve the issue? Restoring the marker is the smallest complete repair because the IPC addition is backward compatible and the existing writer already supports same-format refresh. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6442e281211b. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
PR surfaceSource 0, Tests 0. Total 0 across 2 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall readiness starts with the lower of the proof and patch scores. It is capped at 3/6 if the fix is partial, the change offers little benefit, a product decision is still open, or the PR reverses an earlier decision without saying why. ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 29, 2026, 9:54 PM ET / November 30, 2026, 02:54 UTC. |
|
Rejected review finding: P1 — a format-5 launcher written between #208068 and #208271 retains the pre-#208271 implementation, so This is the explicitly accepted main/dev edge. No release tag contains #208068 ( Manual repair (also recorded in the PR body): stop the affected host Gateway, move its launcher to a backup, invoke the real openclaw gateway stop
# From the trusted checkout containing this PR:
node --import tsx --input-type=module -e '
import fs from "node:fs/promises";
import path from "node:path";
import { resolvePrefix } from "./src/update/store.ts";
import { writeLauncher } from "./src/update/launcher.ts";
const prefix = resolvePrefix();
const launcher = path.join(prefix, "openclaw-launcher.mjs");
await fs.rename(launcher, launcher + ".format-5.bak");
await writeLauncher(prefix);
'
openclaw gateway startKeep the backup until startup succeeds. There is no built-in force-overwrite command: updates call the guarded writer at Verification: an isolated real writer run confirmed format 5 was preserved before the move; moving it aside and calling |
|
Rejected review findings:
|
…08734) ## Summary - Keeps openclaw#208068's `openclaw.usage-error` message, exit-once behavior, and argument-error exit code 1; removes only the launcher format increase (5 → 4). - Restores the existing format-4 refresh regression and protects installed format 5 and higher. Production: +1/-1 (net 0); tests: +4/-4 (net 0). - Current main already moved the documentation to `docs/install/updating/implementation-background.md` and removed the format-specific wording; no further documentation change is needed. ## Checks - Passed on mbp-m5 (vitest-source): `~/.local/bin/ocx test src/update/launcher.test.ts src/update/frozen-contract.test.ts` — 2 files, 20 tests. `src/update/frozen-contract.test.ts` is unchanged. - The launcher regression verifies that different installed format-4 bytes are replaced by a format-4 writer, while a format-5 launcher is preserved. Thus an older format-4 release can restore its launcher after downgrade, without a format lock. - Historical source before openclaw#208068 ignores unknown IPC message types, so the new usage-error message does not change an older launcher's behavior. - [CI](https://github.com/openclaw/openclaw/actions/runs/46342048808): **passed**, including `openclaw/ci-gate`, changed Node tests, lint/types, and Docker seed E2E. - Package Acceptance [`update-restart-auth`](https://github.com/openclaw/openclaw/actions/runs/46342048363/job/141602120900): **passed** (23m05s) at head `cdc9a5a246ece97ae87047355a696e454d69bd74`, with `published_upgrade_survivor_baseline=openclaw@latest`. - The [Package Acceptance parent](https://github.com/openclaw/openclaw/actions/runs/46342048363) is red only because of the unrelated npm 12 install.sh package-budget gate (openclaw#208295): 47,555 entries against a 47,500 budget; size 585.3 MiB is below its 900 MiB budget. ## Accepted edge - A main/dev installation that wrote a format-5 launcher since 2026-11-29 13:00Z keeps that launcher until it is replaced. - No built-in command overwrites an existing higher-format launcher: updates use the guarded writer (`src/update/run.ts:459`, `src/update/launcher.ts:275`), service installation selects the existing launcher, and Doctor only repairs an exact legacy hash. - Manual repair for this unreleased main/dev window: use a trusted checkout containing this fix with its development dependencies installed. Run as the installation owner and explicitly set `OPENCLAW_STATE_DIR` to the affected installation's state directory (including when it normally uses a profile). Unset `OPENCLAW_CONTAINER` when operating on the host Gateway. Stop it with `openclaw gateway stop`, then run the following from that checkout; finally run `openclaw gateway start`. Keep the backup until startup succeeds. This directly invokes the real writer rather than relying on an update that might be an already-current no-op. ```sh node --import tsx --input-type=module -e ' import fs from "node:fs/promises"; import path from "node:path"; import { resolvePrefix } from "./src/update/store.ts"; import { writeLauncher } from "./src/update/launcher.ts"; const prefix = resolvePrefix(); const launcher = path.join(prefix, "openclaw-launcher.mjs"); await fs.rename(launcher, launcher + ".format-5.bak"); await writeLauncher(prefix); ' ``` - `resolvePrefix` selects the installation's `git-install` directory (`src/update/store.ts:41-42`); moving the file aside makes the read return ENOENT (`src/update/launcher.ts:268-273`), so the real writer emits fresh format-4 bytes (`src/update/launcher.ts:275-284`). Verified in an isolated real writer run on Studio after mbp-m5 became unreachable: format 5 was initially preserved; the move-aside/writer sequence created format 4 with container routing and left the backup unchanged. No Gateway or live installation was changed. Co-authored-by: Ayaan Zaidi <[email protected]>
Summary
openclaw.usage-errormessage, exit-once behavior, and argument-error exit code 1; removes only the launcher format increase (5 → 4).docs/install/updating/implementation-background.mdand removed the format-specific wording; no further documentation change is needed.Checks
~/.local/bin/ocx test src/update/launcher.test.ts src/update/frozen-contract.test.ts— 2 files, 20 tests.src/update/frozen-contract.test.tsis unchanged.openclaw/ci-gate, changed Node tests, lint/types, and Docker seed E2E.update-restart-auth: passed (23m05s) at headcdc9a5a246ece97ae87047355a696e454d69bd74, withpublished_upgrade_survivor_baseline=openclaw@latest.Accepted edge
src/update/run.ts:459,src/update/launcher.ts:275), service installation selects the existing launcher, and Doctor only repairs an exact legacy hash.OPENCLAW_STATE_DIRto the affected installation's state directory (including when it normally uses a profile). UnsetOPENCLAW_CONTAINERwhen operating on the host Gateway. Stop it withopenclaw gateway stop, then run the following from that checkout; finally runopenclaw gateway start. Keep the backup until startup succeeds. This directly invokes the real writer rather than relying on an update that might be an already-current no-op.resolvePrefixselects the installation'sgit-installdirectory (src/update/store.ts:41-42); moving the file aside makes the read return ENOENT (src/update/launcher.ts:268-273), so the real writer emits fresh format-4 bytes (src/update/launcher.ts:275-284). Verified in an isolated real writer run on Studio after mbp-m5 became unreachable: format 5 was initially preserved; the move-aside/writer sequence created format 4 with container routing and left the backup unchanged. No Gateway or live installation was changed.