Repository navigation
fix: preserve standalone CLI profiles and settle Doctor shutdown - #173154
Conversation
|
🦞👀 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d1f0cb2ffb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex review: needs changes before merge. What this changesThis PR preserves standalone CLI arguments and makes Doctor settle failed snapshot resources and stop inspections after cancellation. Example: Run
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 3 items remain Keep open: this PR addresses concrete runtime failures, but two incomplete dependency inventories currently break packaged launches and PR tooling. Priority: P1 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe launch planner translates executable identity and CLI arguments into child-process invocations; Doctor coordinates inspections, snapshot workers, cleanup, and maintenance recovery. flowchart TD
A[CLI arguments] --> B[Invocation planner]
B --> C[Loose or standalone executable]
C --> D[Doctor inspections]
D --> E[Snapshot worker and broker]
E --> F[Resource settlement]
D --> G[Maintenance recovery]
F --> H[Command exit]
G --> H
Technical reviewBest possible solution: Keep the shared invocation and cleanup owners, complete their distribution inventories, and preserve the existing worker-dispatch and maintenance-recovery contracts. Do we have a high-confidence way to reproduce the issue? The pinned source explains the reported script-as-command failure and the introduced missing-module failures; GitHub annotations additionally reproduce the wrapper failure, and no target code was executed during this review. Is this the best way to solve the issue? Centralizing invocation shape and repairing cleanup custody address the owning boundaries, but the cutover is incomplete until every curated distribution includes the new imports. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7bbdbcf486ce. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +260, Tests +530, Docs +47, Config +1, Other +303. Total +1141 across 74 files. Added test files: 5. 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 15, 2026, 9:37 AM ET / 13:37 UTC. |
7c57577 to
bf0d98d
Compare
4ab1168 to
9ba6561
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a39dc49c74
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 50cfae4f32
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Use one bootstrap-safe owner for standalone identity and CLI invocation shape. Route startup, compile-cache, Doctor, update, and runtime CLI children through it while retaining explicit worker protocols and pinned target identity. Qualify the relocated Doctor with an explicit profile and normal startup respawn enabled.
Stop admitting optional Doctor checks after CLI cancellation and propagate the signal to ordinary read-only inspections. Preserve the independent maintenance recovery lifetime so cancellation cannot prevent restoring a stopped Gateway. Add cancellation and recovery regressions plus a standalone SIGTERM repro mode.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4ba5b010dc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "files": [ | ||
| "CHANGELOG.md", | ||
| "LICENSE", | ||
| "cli-invocation.mjs", |
There was a problem hiding this comment.
Include the launcher helper in upgrade identity checks
Adding cli-invocation.mjs to the published package makes it part of the immutable launcher payload, but scripts/e2e/lib/upgrade-survivor/worker-cell-package.mjs still hashes and extracts only package.json, openclaw.mjs, and dist (lines 44 and 145-147). The upgrade-survivor identity comparison can therefore accept an installed candidate whose required launcher helper is missing or altered, despite claiming to verify the complete application payload; include this new file in both inventories.
AGENTS.md reference: AGENTS.md:L52-L53
Useful? React with 👍 / 👎.
|
Merged via squash.
|
The bootstrap-safe cli-invocation.mjs added by #173154 was missing from both focused guard aliases. Include it at the package-script owner so the existing root-executable coverage regression passes and the new bootstrap owner receives the same guards as the other root entrypoints. Focused tooling proof: 30/30 across the boundary and type-shard files; the separately landed avatar reference repair is 35039a4. The actual focused boundary command and targeted tooling/UI-component types pass. Independent P2 review is clean. Coverage assertions and runtime behavior are unchanged.
* commit '56c315156f4542f197a2b7f727681ba3f41c21b5': (23 commits) fix(ui): remove stale Lit cleanup from model catalog tests refactor(tests): consolidate iMessage discovery checks (#173624) fix(auto-reply): retire older collect cancellation after admission fix(memory): avoid rebuilding initially empty indexes after restart (#173622) fix(test): preserve subprocess runtime identity (#173446) perf(sessions): batch transcript index reconciliation (#173620) fix(gateway): share GitHub options preparation during reconnects (#173589) perf(control-ui): open the composer model picker without list-wide work (#173275) fix: finish compile-cache cleanup after short CLI commands exit (#173603) refactor(ui): finish native shell rendering (#171554) fix: preserve standalone CLI profiles and settle Doctor shutdown (#173154) refactor: centralize agent memory host typing (#173619) fix: camera fallback picker opens away from the attachment button (#173618) refactor: deduplicate existing CI runner routing with YAML anchors (#172670) fix(ai): preserve multiline Google replies and report malformed streams (#173612) refactor(tests): remove duplicate speech policy test (#173606) refactor(ui): simplify page rendering and derivations (#173608) fix(release): Linux channel promotion fails after a withdrawn Windows companion (#173615) fix(update): wait for native Gateway ownership before restarting (#173588) test(sessions): admit schema probe fixture writes behind maintenance ...
…nclaw#173154) Preserve explicit profiles across standalone CLI respawns through one bootstrap-safe invocation owner. Select loose runtime/script arguments or direct compiled arguments from the embedded builder fact or adjacent manifest. Include the owner and compile-cache workers in packaged launchers and standalone builds. Settle worker execution and native resource closure independently after snapshot failure. Release startup-refused broker claims only after native process and pipe closure, retain cleanup transport on operation failure, propagate Doctor snapshot errors, and cancel further inspections without losing maintenance restoration. Document the private Unix-domain bind/connect allowance required by both loose and standalone snapshot workers. Keep network, home, Keychain, launchctl, and host-SQLite denials in the relocated verifier. Validation: signed production-pinned JIT and bytecode artifacts at 4aa64f9 passed explicit-profile Doctor, Gateway/agent/restart campaigns, denied-IPC failure, and SIGTERM settlement in 364/375 ms with unchanged deadlines. Later source repairs passed owning-boundary regressions, scoped checks, and independent review. Signed artifact identity is preserved separately from the final CI head. Exact-head CI for 9617855: 172 successful jobs, 19 skipped, zero failures (run 38833042547). Tested merge 58c3b87a8594 has the same tree as the prepared PR head. No CI exception, rerun, or timeout increase.
…173663) The bootstrap-safe cli-invocation.mjs added by openclaw#173154 was missing from both focused guard aliases. Include it at the package-script owner so the existing root-executable coverage regression passes and the new bootstrap owner receives the same guards as the other root entrypoints. Focused tooling proof: 30/30 across the boundary and type-shard files; the separately landed avatar reference repair is 06249c0. The actual focused boundary command and targeted tooling/UI-component types pass. Independent P2 review is clean. Coverage assertions and runtime behavior are unchanged.
* fix(ci): share the iOS screenshot build * fix(ci): preserve the screenshot artifact container on download * merge: integrate main for iOS screenshot workflow conflicts * style(ci): format the combined screenshot evidence changes * docs(ci): name the combined screenshot capture * fix(ios): expose screenshot simulator creation errors * Merge main at 56c3151 to include the UI test cleanup fix * commit '56c315156f4542f197a2b7f727681ba3f41c21b5': (23 commits) fix(ui): remove stale Lit cleanup from model catalog tests refactor(tests): consolidate iMessage discovery checks (#173624) fix(auto-reply): retire older collect cancellation after admission fix(memory): avoid rebuilding initially empty indexes after restart (#173622) fix(test): preserve subprocess runtime identity (#173446) perf(sessions): batch transcript index reconciliation (#173620) fix(gateway): share GitHub options preparation during reconnects (#173589) perf(control-ui): open the composer model picker without list-wide work (#173275) fix: finish compile-cache cleanup after short CLI commands exit (#173603) refactor(ui): finish native shell rendering (#171554) fix: preserve standalone CLI profiles and settle Doctor shutdown (#173154) refactor: centralize agent memory host typing (#173619) fix: camera fallback picker opens away from the attachment button (#173618) refactor: deduplicate existing CI runner routing with YAML anchors (#172670) fix(ai): preserve multiline Google replies and report malformed streams (#173612) refactor(tests): remove duplicate speech policy test (#173606) refactor(ui): simplify page rendering and derivations (#173608) fix(release): Linux channel promotion fails after a withdrawn Windows companion (#173615) fix(update): wait for native Gateway ownership before restarting (#173588) test(sessions): admit schema probe fixture writes behind maintenance ... Co-authored-by: Vincent Koc <[email protected]>
* fix(ci): share the iOS screenshot build * fix(ci): preserve the screenshot artifact container on download * merge: integrate main for iOS screenshot workflow conflicts * style(ci): format the combined screenshot evidence changes * docs(ci): name the combined screenshot capture * fix(ios): expose screenshot simulator creation errors * Merge main at a11e38b to include the UI test cleanup fix * commit 'a11e38b8bb1eb58aaf392a0eab458dbb47aad30f': (23 commits) fix(ui): remove stale Lit cleanup from model catalog tests refactor(tests): consolidate iMessage discovery checks (openclaw#173624) fix(auto-reply): retire older collect cancellation after admission fix(memory): avoid rebuilding initially empty indexes after restart (openclaw#173622) fix(test): preserve subprocess runtime identity (openclaw#173446) perf(sessions): batch transcript index reconciliation (openclaw#173620) fix(gateway): share GitHub options preparation during reconnects (openclaw#173589) perf(control-ui): open the composer model picker without list-wide work (openclaw#173275) fix: finish compile-cache cleanup after short CLI commands exit (openclaw#173603) refactor(ui): finish native shell rendering (openclaw#171554) fix: preserve standalone CLI profiles and settle Doctor shutdown (openclaw#173154) refactor: centralize agent memory host typing (openclaw#173619) fix: camera fallback picker opens away from the attachment button (openclaw#173618) refactor: deduplicate existing CI runner routing with YAML anchors (openclaw#172670) fix(ai): preserve multiline Google replies and report malformed streams (openclaw#173612) refactor(tests): remove duplicate speech policy test (openclaw#173606) refactor(ui): simplify page rendering and derivations (openclaw#173608) fix(release): Linux channel promotion fails after a withdrawn Windows companion (openclaw#173615) fix(update): wait for native Gateway ownership before restarting (openclaw#173588) test(sessions): admit schema probe fixture writes behind maintenance ... Co-authored-by: Vincent Koc <[email protected]>
Close the retained rehearsal broker before deleting its socket directory. Observe the native snapshot cleanup receipt on Windows rather than a parent-process fs spy, retaining the real open-handle blocker and source preservation assertions. The native-child cutovers in #173154 and #176334 exposed these stale fixture assumptions.
…7526) A resource failure may arrive over parent IPC after the worker socket has already observed it and finished native cleanup. Do not reject the parent's pending close with that delayed failure; keep reporting the original error and wait for the independent close receipt or actual cleanup failure. Add a deterministic delayed-failure regression with retained custody and close/release assertions. This preserves the separate execution and native settlement contract from #160946 and #173154. Validation: regression red on the old owner; 30 focused cases pass under Node and Bun with one worker. Targeted types, lint, format and P2 review pass.
…nclaw#177526) A resource failure may arrive over parent IPC after the worker socket has already observed it and finished native cleanup. Do not reject the parent's pending close with that delayed failure; keep reporting the original error and wait for the independent close receipt or actual cleanup failure. Add a deterministic delayed-failure regression with retained custody and close/release assertions. This preserves the separate execution and native settlement contract from openclaw#160946 and openclaw#173154. Validation: regression red on the old owner; 30 focused cases pass under Node and Bun with one worker. Targeted types, lint, format and P2 review pass.
What Problem This Solves
Standalone CLI re-execution passed the loose runtime's
runtime/openclaw.mjsoperand back into the compiled executable, which parsed it as a command.cli-invocation.mjsnow owns both executable identity and argument shape: loose<runtime> <entry> <args>versus standalone<exe> <args>. It uses the embedded builder fact for the current executable and the adjacent manifest for another executable, without hashing. CLI respawns and runtime CLI children consume this owner; registered embedded child programs keep their own dispatch protocol. Compile-cache workers and the bootstrap module are included in the appropriate embedded/package inventories.Doctor had two further defects. A snapshot failure could be swallowed by optional inspections, yielding a false completion, and the compiled process could remain stuck behind a native cleanup barrier after SIGTERM. Execution completion and physical resource closure are now settled independently. Confirmed broker startup refusal releases undispatched resource claims only after the broker process and pipes close; operation errors retain the transport needed for cleanup. Doctor reports snapshot failures, exits nonzero, and stops admitting inspections after cancellation while preserving maintenance restoration.
Sandbox contract
The reported allocation error occurred before SQLite snapshot allocation: the sandbox denied the spawn broker's AF_UNIX bind at
$TMPDIR/oc-br-*/resource.sock. Both loose and standalone Doctor use this broker, throughsqlite-snapshot-staging-ownerandworker-native-lifecycle. A same-source loose Doctor control reproduced the denial. The earlier passing loose verifier exercised version/help and a direct SQLite import, not that Doctor path.After
(deny network*), allow only local IPC under the isolated temporary root:IP networking, operator home, Keychain, launchctl, and host SQLite remain denied. Use a short canonical temporary root for Darwin's Unix-socket path limit.
docs/install/standalone.mddocuments the requirement.Evidence
Signed production-pinned builds at
4aa64f9ddc294passed both JIT and bytecode qualification. These are exact artifact identities, not claims that later source-only repairs were rebuilt.The original 60-second command limits are unchanged. Original loose Doctor printed false completion and stayed alive for 90 seconds, but SIGTERM already worked there; the original compiled process required SIGKILL. The fix does not claim an OS-level signal or Atomics defect.
The paired explicit-profile campaign passed config, Doctor, two Gateway generations, agent turns, restart, and stop: strict proof 402.053 s, 181/179 observed JIT/bytecode workers, zero disk-JavaScript execution; functional proof 4/4 rounds per mode in 1088.723 s. Delayed audit covered 453 owned PIDs with no owned or uncertain crashes. Builds and per-run state were retired after proof under the shared-disk policy; logs, JSON, and manifests remain.
Focused owner regressions cover invocation, embedding, broker startup refusal, resource settlement, snapshot propagation, cancellation, and maintenance restoration. Eighteen files passed with
pnpm test <file> --maxWorkers=1; full build passed in 426.232 s. Independent Codex review is clean through P2. Later repairs also passed negative controls, focused tests, types, lint, format, and independent review: native-exit shutdown classification (19 transport/stderr tests, 35.654 s; exact CI Node 24.19 auth pair, 36.246 s), and the completedoctorreadiness-command receipt (7 tests, 28.207 s). The source execution argv is unchanged by the receipt repair.Reproduce either signed production-pinned mode:
The script APFS-clones the artifact, uses isolated state and an explicit profile, and preserves normal startup respawn. The interrupt case requires exit 143 and process-tree cleanup within two seconds. There is no Doctor skip, timeout increase, or interpreter fallback.
CI and integration
Head
9617855492767integrates main172aae503c51c. Exact-head CI 38833042547 passed: 172 successful jobs, 19 skipped, zero failures, including the aggregate gate. The tested merge58c3b87a8594has the prepared main/head parents and the same tree as the PR head. No CI exception or rerun was used. Previous head4ba5b010dcc62completed with 168 successful jobs, 19 skipped, and three failed extension bundles plus the gate. Scheduled main had no matching jobs, so no automatic inheritance classification or admin exception was used.The browser, voice-call, and Synology failures reproduced on the actual main parent
44998b0afc07. Main172aae503c51cfixes lifecycle cleanup lost behind an activity-cancelled browser sweep, scopes the voice fixture's worker-retirement assertions to its own workers, and restores Synology's fake timers before native shutdown. Telegram's relevant cases passed normal local replays; a controlled 1.25-second initialization delay exposed the one-second readiness assumption, and the repaired registration barrier passed all three delayed cases without changing deadlines or shutdown assertions.That repair passed 53 focused cases, extension production/test types, lint, format, and independent Codex review through P2. Negative controls prove the browser regression catches a lost close and the voice assertion catches omitted database retirement. After integrating main's GC changes, voice and Synology passed again in 48.817 s and 44.409 s. The final rebases preserve the reviewed patch byte-for-byte. Historical investigated local failures remain in native review evidence, including a Node wire timeout whose original cause was not established; later exact-head CI passed that case.
The builder parent #172802 has merged, so this PR targets main. Desktop packaging #172569 consumes the shared invocation API and owns daemon migration. Stacked #173473 owns remaining standalone entry-discovery consumers and their separate live qualification.