Repository navigation
fix(update): continue when service inspection is unavailable - #150494
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: blocked before merge. Reviewed September 17, 2026, 4:04 AM ET / 08:04 UTC (Revision 8). ClawSweeper reviewWhat this changesThe PR lets updates and Doctor continue with service-inspection warnings, prevents unverified service records from selecting installation state, and clarifies Linux status and manual restart guidance. Merge readiness⛔ Blocked before merge - 3 items remain This repair remains necessary: fetched main still refuses unavailable service inspection. No blocking code defect was found. The maintainer explicitly accepted the operational tradeoff and documented the remaining upgrade-evidence gap, resolving the previous review’s human decision. Priority: P1 Review scores
Verification
How this fits togetherThe updater uses native service inspection to select an installation and coordinate Gateway shutdown and restart. Doctor separately controls access to persistent state while maintenance runs. flowchart TD
A[Update invocation] --> B[Inspect native service]
B --> C{Ownership verified?}
C -->|Yes| D[Select owned installation]
C -->|Unavailable| E[Keep invoking installation and warn]
D --> F[Install and run Doctor]
E --> F
F --> G[State writer exclusions]
F --> H[Owned restart or manual restart guidance]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +141, Tests +720, Docs +30. Total +891 across 41 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one verified service-selection owner, preserve independent state-maintenance exclusions, and make manual supervisor recovery explicit whenever automatic lifecycle management is unavailable. Do we have a high-confidence way to reproduce the issue? Yes, from source: unavailable native inspection reaches the fatal admission guard on fetched main and v2026.9.4. Historical Linux traces corroborate it; this review did not execute a reproduction. Is this the best way to solve the issue? Yes. Sharing the verification predicate across selection and maintenance fixes the refusal without granting stale records service authority; the changed restart behavior has explicit maintainer acceptance. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a09a0461bc08. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
8b04630 to
b55593b
Compare
1e1dcb8 to
0bab06f
Compare
Treat unavailable native service inspection as an advisory and keep stale record selectors out of package, Node, config, and state selection. Preserve known-manager state vetoes and retained activation ownership. Report absent managers and stale units accurately, and carry manual restart guidance through Doctor and update history. Reported by a Slackware operator running OpenClaw 2026.9.4.
Use the maintenance inspection verdict before service records can select an update package, Node runtime, config path, or state directory. Keep manager identity, package ownership, command bounds, and retained recovery checks in one read-only owner. Reject oversized records before foreign-root handling. Prove stale selector isolation at update preparation and admission, including valid-service controls on Linux and macOS. Align service fixtures with verified manager identity and retained handoffs, and assert effective-unit behavior through the current reader contract.
Decode captured launchd fixture bytes through the existing plutil test adapter so Linux exercises the same native inspection reasons as macOS. Preserve the repair and status assertions. Model unavailable systemd transports explicitly and replace retired admission refusals with strict advisory, no-selector, and no-mutation assertions.
0bab06f to
5960b24
Compare
|
Merged via squash.
|
Fix Node aborting when PDF extraction is cancelled during native PNG compression. Related: #150494; reproduced in CI run 35193123721, job 105110271154. The shared worker pool atomically closes native-section admission and waits for active native work before terminating the worker. PDF extraction fences only pixel- and dimension-bounded PNG encoding, checks cancellation between pages, and keeps rendering immediately cancellable. Admission and execution capacity remain reserved until worker exit. The existing worker SDK exports and handlers stay compatible, and the two extracted pool modules are included in the native wrapper inventory. Cancellation can wait beyond its deadline if a fenced native operation gets stuck; the bounded-operation SDK contract documents this accepted tradeoff. Archived-history zstd cancellation remains a separate follow-up. No configuration, dependency, Node-version, or persistence changes are required. Validation: Linux Node 24.19.0 reproduced SIGABRT before the fix and clean abort, timeout, close, and unexpected-exit cases afterward. The author recorded 51 pool tests, 23 PDF tests, and 20 serial PDF and extension-stripe repetitions passing. Hosted exact-head CI run 35208006886 is green; local full-stripe and provisioning timing limitations are documented in the PR. Codex autoreview and the exact-head ClawSweeper review found no actionable P0/P1 correctness findings.
…w#150494) Allow updates to continue with recorded warnings when native service inspection is unavailable. Share verified service inspection between early target selection and maintenance so unverified records cannot select the package, Node runtime, configuration, or state directory and cannot authorize native service mutation. Keep verified ownership conflicts, retained recovery, coordinator, active-writer lease, and parent-activation checks. Report unsupported Linux service managers and stale unit records accurately, and carry manual-restart guidance through Doctor and update history. The installed 2026.9.4 updater can refuse before candidate code runs; document the backed-up manual package-manager first hop through the actual supervisor. Reported by a Slackware operator running OpenClaw 2026.9.4. Validation: exact-head CI run 35194036285 passed with zero pending checks. The campaign review of record is scoped clean with no accepted P0/P1 findings. Earlier focused proof passed 124 tests on each of macOS and Linux. Full candidate upgrade with existing operator state and supervisor recovery remains an explicitly documented evidence gap.
…50752) Fix Node aborting when PDF extraction is cancelled during native PNG compression. Related: openclaw#150494; reproduced in CI run 35193123721, job 105110271154. The shared worker pool atomically closes native-section admission and waits for active native work before terminating the worker. PDF extraction fences only pixel- and dimension-bounded PNG encoding, checks cancellation between pages, and keeps rendering immediately cancellable. Admission and execution capacity remain reserved until worker exit. The existing worker SDK exports and handlers stay compatible, and the two extracted pool modules are included in the native wrapper inventory. Cancellation can wait beyond its deadline if a fenced native operation gets stuck; the bounded-operation SDK contract documents this accepted tradeoff. Archived-history zstd cancellation remains a separate follow-up. No configuration, dependency, Node-version, or persistence changes are required. Validation: Linux Node 24.19.0 reproduced SIGABRT before the fix and clean abort, timeout, close, and unexpected-exit cases afterward. The author recorded 51 pool tests, 23 PDF tests, and 20 serial PDF and extension-stripe repetitions passing. Hosted exact-head CI run 35208006886 is green; local full-stripe and provisioning timing limitations are documented in the PR. Codex autoreview and the exact-head ClawSweeper review found no actionable P0/P1 correctness findings.
What Problem This Solves
Fixes
openclaw updaterefusing withmanaged-service-preflightwhen native service inspection is unavailable, including the 2026.9.4 failure reported by a Slackware operator running a manually launched Gateway with a stale systemd unit.User Impact
Updates continue with a recorded warning and a concrete action: restart the Gateway you launched manually after the update. Unverified service definitions remain unchanged. Linux status reports “no supported service manager detected,” identifies a recorded stale unit, and probes the current CLI configuration and port.
The installed 2026.9.4 updater rejects before candidate code runs. Affected operators need the documented manual package-manager procedure for that first hop; changing the target or adding
--no-restartcannot fix the already-running driver.Why This Change Was Made
The update owner treated unavailable inspection as a fatal ownership failure. Early target selection and maintenance now share one verified service-inspection predicate, including manager identity, package ownership, and command-size checks. Unavailable verdicts carry no service-derived package, Node, configuration, or state selectors. Doctor returns the service advisory through its existing warning result; state coordinators, database leases, and parent activation ownership remain enforced. A reachable manager with conflicting record selectors still refuses before state access.
Native detection distinguishes absent managers from session-bus, permission, and timeout failures. Unit-file presence alone, including records in both systemd scopes, does not prove a live owner; unavailable inspection remains advisory while live writer exclusions still apply. Retained handoff fingerprints still protect recovery. Related activation ownership: #146514 and #147720.
No new configuration, CLI options, environment variables, dependencies, or storage schema changes.
Evidence
The ownership-admission CI follow-up corrects twelve failures in run 35181650861. Four failures came from fixtures that lacked the native load/runtime/manager facts now required by the shared predicate; supplying those facts restored service-state selection, pending recovery, redirected package recovery, and root-error propagation without changing their assertions. The remaining eight cases asserted the fatal refusal this PR retires. Their expectations now enforce typed warnings, no service selector or mutation authority, unchanged service material, and manual-restart guidance.
Per-case reasons for the eight warning outcomes:
unloaded-local: a local unit file without a loaded effective command cannot establish service ownership.unloaded-global: a disabled global unit without a loaded effective command cannot establish service ownership.denied: permission-denied command inspection supplies no verified record.timeout: a timed-out command inspection supplies no verified record.malformed: invalid native JSON cannot establish a service snapshot.unresolved-root: an opaque launcher cannot establish package ownership.native-rejection: a failed native command read is advisory and must not leak its exception text.native-value-rejection: a non-Error native rejection is advisory and must not leak its payload.The three-state table covers unavailable inspection, verified ownership conflict/pending recovery, and verified redirection on Linux and macOS adapter seams. Typed refusals and verified selector assertions remain unchanged. The original thirteen-case ownership table moved to its own focused test file to keep the existing run suite below its line cap. A stale documentation paragraph now describes the same best-effort contract.
The pre-PR probe substituted only
update-command-run.tsfrom383ec378fe9df34e0e03b69e7dd8a8e677b45650; all eight new expectations failed on its retired fatal ownership refusal. The exact candidate source was restored before validation. Focused proof covers update run/admission, pending recovery, the extracted native-reader table, the three-state table, service planning, selectors, runtime preview, and Doctor inspection. Source and lockfile digests matched between hosts.pnpm check:changedpassed completely onbbf978e0b1fea86a9e6914d201e5caa9b7206e74; no extension-lint substitute was needed. Fresh Codex autoreview with--mode branch --base origin/main --max-priority P1was scoped clean in both batches, with the three-state contract explicit in its instructions.All five commits rebased patch-identically onto
92fdb4bfe91e9134bc219dbbba89aaffe2500e73: every range-diff entry was=, and the full patch ID stayeda1398476f486e7324c775d8071990cc94d869339. No upstream edits overlapped this PR's files. Frozen-lockfile installs passed on macOS and Linux, then all 124 focused tests passed again on each host at head1e1dcb87a36caa3527a8d317e20edb000b3ba5ec. The Linux proof used a disposable Node 24 container. The task container was removed after proof.Full PR LOC: production +344/−203 (net +141), tests/support +1293/−573 (net +720), docs +37/−7 (net +30).
This follow-up: production 0; tests +455/−227 (net +228); docs +8/−7 (net +1). No new options, dependencies, schemas, baselines, or suppressions. No production build boundary changed.
Earlier runtime-preview repair: the unchanged sixteen-case suite passed on main
af9080aa93a; the two branch failures came from missing native fixture facts. The compatible current CLI Node remains the replacement runtime for an incompatible, refreshable owned service.Original admission/status proof and earlier CI repairs
Published 2026.9.4 and the pre-fix built CLI reproduced the dead end in a Linux container with isolated state, no systemd, and a stale unit:
The initial PR build at
93a231f9bc1exited 0 in the same isolated setup. Its update preview recorded:Its built
gateway status --deep --no-probealso exited 0:These are historical built-binary captures of the original repair. Later selector and finalization changes use registered CLI boundary tests; no host state or existing Gateway was modified. The installed 2026.9.4 driver's first-hop limitation remains as documented above.
Earlier validation covered 500 native/status tests (one existing skip), 130 Doctor tests, CLI admission/staging/finalization and warning/history propagation, and retained launcher recovery. The early-selector regression reproduced four invalid-record failures; valid-service controls passed. After unifying the predicate, all six cases pass and an unverified record cannot select its different package, Node executable, configuration, or state directory.
The previous CI repair at
8b04630b163passed 83 tests on macOS and Linux. Launchd fixtures now decode captured plist data without calling macOS-only/usr/bin/plutilon Linux; managerless fixtures assert the typed warning and absent selector/mutation authority. Earlierpnpm buildatb6c94245ce1exited 0 and reported an unrelated Control UI gzip overage of 159 bytes; no UI baselines changed. That build is historical, not a build of this head.The original refusal is at
update-command-run.ts:135. Unavailability includes failed effective-command/native reads, unknown load/runtime state, unverified Linux manager identity, missing commands without affirmative absence/lock/port proof, oversized commands, and unresolved package ownership. Shipped retained handoffs preserve fingerprinted recovery. Windows uses the same verdict through the Task Scheduler reader; that sibling was source-reviewed, not live-tested. Launchd inspection failures were exercised at the adapter boundary.Maintainer disposition of ClawSweeper revision 7
The exact-head review found no actionable code or security defect. The remaining merge-risk judgment is accepted for this repair: unavailable native inspection cannot grant service stop/restart authority, so package replacement continues with explicit manual-restart guidance while Doctor retains coordinator, active-writer lease, and parent-activation exclusions. A supervisor may still need to stop the running Gateway before maintenance and restart it afterward.