Repository navigation
fix: preserve standalone CLI commands across startup respawns - #174545
Conversation
Resolve launcher-bound runtime arguments at the CLI invocation owner. Consume a one-child parent PID signal in compiled runtimes while preserving the loose preload and detached worker lifetimes.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs changes before merge. What this changesResolve parent-bound CLI respawns centrally so standalone executables receive command arguments without Node preload flags. Example: Run standalone
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenanceRegression provenance — verified: source commit Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: this maintainer-authored PR addresses a current standalone startup regression, but its new bootstrap dependency breaks compiled CLI test artifacts. Priority: P1 Before merge
Findings
Tests
Agent review detailsHow this fits togetherCLI bootstrap prepares executable identity, arguments, and environment; spawn transports launch the prepared invocation, while the child lifecycle owner handles launcher loss. flowchart TD
A[CLI startup] --> B[Invocation owner]
B --> C[Loose runtime preload]
B --> D[Standalone parent marker]
C --> E[Spawn transport]
D --> E
E --> F[CLI command and lifecycle]
Technical reviewBest possible solution: Keep invocation planning centralized and include its complete bootstrap dependency closure wherever CLI artifacts are copied. Do we have a high-confidence way to reproduce the issue? Current-main source exposes the standalone argument corruption, matching the maintainer's signed-artifact report; this read-only review executed no target code. Is this the best way to solve the issue? Moving runtime argument construction into the existing invocation owner fixes the responsible boundary, but copied test runtimes must include the newly required modules. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 956dd5d98995. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +8, Tests +172, Docs +3, Other +48. Total +231 across 21 files. Added test files: 0. View PR surface stats
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 follows the weaker of proof and patch quality; ✨ 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 October 16, 2026, 3:01 PM ET / 19:01 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
Reuse the Vitest runtime asset owner for copied update candidates. Replace empty parent-lifetime and shutdown-budget stubs beside the real invocation module in bootstrap fixtures. Derive the paired-node upgrade fixture's launcher files from its existing entrypoint seeds and eager import closure. Update behavior is unchanged: migrated candidates still validate config, prove readiness, reject replaced owners and retain unconfirmed recovery results. This fixes fixture drift after the parent-bound CLI invocation change in #174545, not production update authority or package contents. The trusted Docker harness is already repaired by #174463. Local Node 24 proof, maxWorkers=1: - Bootstrap baseline: 16 failures / 29 passes; all five importing suites now pass (49 tests, 86.42s). - Update baseline: two failures / two passes; all three importing suites now pass (36 tests, 342.13s). Healthy authority case: 76.20s failing before readiness -> 37.40s passing with every assertion retained. - Paired-node upgrade: passes before and after (366.36s -> 271.28s Vitest wall; different preparation/cache conditions, not a speedup claim). Its existing scenario enters dist/index.js. A separate isolated root launcher smoke proves the old copy list exits 1 for missing parent lifetime while the derived closure exits 0 and prints the version. - Existing trusted-harness case passes. Targeted CLI, gateway and E2E typechecks, scoped lint, boundary lint, format, import cycles and P2 autoreview pass. Windows was not available locally; no CI dispatched.
…aw#174545) * fix: preserve standalone CLI commands across startup respawns Resolve launcher-bound runtime arguments at the CLI invocation owner. Consume a one-child parent PID signal in compiled runtimes while preserving the loose preload and detached worker lifetimes. * test: keep respawn transport guard independent of local names * test: include respawn owner dependencies in CLI fixtures
Reuse the Vitest runtime asset owner for copied update candidates. Replace empty parent-lifetime and shutdown-budget stubs beside the real invocation module in bootstrap fixtures. Derive the paired-node upgrade fixture's launcher files from its existing entrypoint seeds and eager import closure. Update behavior is unchanged: migrated candidates still validate config, prove readiness, reject replaced owners and retain unconfirmed recovery results. This fixes fixture drift after the parent-bound CLI invocation change in openclaw#174545, not production update authority or package contents. The trusted Docker harness is already repaired by openclaw#174463. Local Node 24 proof, maxWorkers=1: - Bootstrap baseline: 16 failures / 29 passes; all five importing suites now pass (49 tests, 86.42s). - Update baseline: two failures / two passes; all three importing suites now pass (36 tests, 342.13s). Healthy authority case: 76.20s failing before readiness -> 37.40s passing with every assertion retained. - Paired-node upgrade: passes before and after (366.36s -> 271.28s Vitest wall; different preparation/cache conditions, not a speedup claim). Its existing scenario enters dist/index.js. A separate isolated root launcher smoke proves the old copy list exits 1 for missing parent lifetime while the derived closure exits 0 and prints the version. - Existing trusted-harness case passes. Targeted CLI, gateway and E2E typechecks, scoped lint, boundary lint, format, import cycles and P2 autoreview pass. Windows was not available locally; no CI dispatched.
The built-CLI runtime recovery suite only runs in CI when the shared test instance helper changes, so two of its cases kept asserting behavior that main retired: - Runtime-recovery respawns now carry the launcher-bound parent-lifetime preload and an IPC channel (#174268, #174545); the Doctor recovery case still expected bare argv and plain inherited stdio. - Compiled entries keep the build-scoped compile cache and no longer take the compile-cache-disable respawn, which is source-entry only (#170514); the compile-cache case still expected that respawn's marker. Assert the current respawn shape and that compiled entries keep caching while still keeping workspace roots out of the startup respawn.
…wns (#177503) The built-CLI runtime recovery suite only runs in CI when the shared test instance helper changes, so two of its cases kept asserting behavior that main retired: - Runtime-recovery respawns now carry the launcher-bound parent-lifetime preload and an IPC channel (#174268, #174545); the Doctor recovery case still expected bare argv and plain inherited stdio. - Compiled entries keep the build-scoped compile cache and no longer take the compile-cache-disable respawn, which is source-entry only (#170514); the compile-cache case still expected that respawn's marker. Assert the current respawn shape and that compiled entries keep caching while still keeping workspace roots out of the startup respawn.
…wns (openclaw#177503) The built-CLI runtime recovery suite only runs in CI when the shared test instance helper changes, so two of its cases kept asserting behavior that main retired: - Runtime-recovery respawns now carry the launcher-bound parent-lifetime preload and an IPC channel (openclaw#174268, openclaw#174545); the Doctor recovery case still expected bare argv and plain inherited stdio. - Compiled entries keep the build-scoped compile cache and no longer take the compile-cache-disable respawn, which is source-entry only (openclaw#170514); the compile-cache case still expected that respawn's marker. Assert the current respawn shape and that compiled entries keep caching while still keeping workspace roots out of the startup respawn.
What Problem This Solves
Fixes standalone/desktop agent turns, Doctor, and plugin installation exiting before command dispatch when normal startup respawns the CLI.
Related: #174268
User Impact
Standalone artifacts incorporating 75d827b are affected, including the reported signed desktop qualification artifact. This confirms current main/desktop candidate impact; the public stable desktop release provenance was not audited here. Default agent turns, live
doctor, upgradedoctor --fix, and Teams installation encounter the parent preload URL as an unknown command. The workaroundOPENCLAW_NO_RESPAWN=1bypasses the failing path; normal startup must work without it.Why This Change Was Made
The spawn transports added Node runtime arguments after
cli-invocation.mjshad selected the compiled<executable> <CLI args>shape. The invocation owner now resolves parent-bound respawns, places the existing preload before the loose entry script, and supplies compiled children with a one-use parent-PID environment marker instead. The child consumes that marker before detached workers can inherit it. Both spawn transports pass the resolved argv through unchanged; exec replacement and independent worker lifetimes retain their existing contracts.Evidence
npm:@openclaw/[email protected]installation each reproduced exit 1. The isolated Gateway stayed healthy around the live Doctor check.pnpm build, core typecheck, touched-file lint and formatting passed. Independent Codex P0/P1 review is clean.doctor --fixexits 0 (42.253s); Teams install exits 0 (26.395s), then runtime inspection exits 0 (24.576s). NoOPENCLAW_NO_RESPAWNwas used. State and Gateway were isolated; native Codex auth was reused without copies.