Repository navigation
fix(update): name the failing preflight check, the resolved install, and the detected runtime when refusing - #166410
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: needs changes before merge. Reviewed October 7, 2026, 2:35 AM ET / 06:35 UTC (Revision 4). ClawSweeper reviewWhat this changesThe PR adds named runtime and service checks, installation paths, detected facts, and recovery guidance to update refusals, and documents a pre-upgrade checklist. Merge readiness⛔ Needs changes before merge - 1 item remains This remains useful work: current main lacks the complete refusal diagnostics, and the reviewed patch introduces no concrete blocking correctness finding. The verified maintainer-authored PR must remain open. Priority: P3 Review scores
Verification
How this fits togetherThe updater compares the selected installation and runtime with package requirements and managed Gateway observations before changing code or restarting services. Its failure-report owner turns refused checks into local diagnostics and sanitized support reports. flowchart TD
A[Update invocation] --> B[Selected installation and runtime]
C[Managed Gateway observations] --> D[Existing preflight checks]
B --> D
D --> E[Shared refusal diagnostics]
E --> F[Local recovery guidance]
E --> G[Sanitized support report]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +87, Tests +120, Docs +14, Other +1. Total +222 across 24 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep refusal diagnostics with the existing failure-report owner while preserving admission decisions, installation-specific recovery, and public redaction. Do we have a high-confidence way to reproduce the issue? Not applicable as a diagnostics improvement; current-main source shows the omitted installation context, and focused regression coverage exercises the changed refusal paths. Is this the best way to solve the issue? Yes. Reusing the existing failure-fact and formatter owners avoids competing diagnostics and preserves the existing update decisions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against eb1b48c58b61. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
Name the failed check, show compared runtime and installation facts, and preserve actionable recovery guidance through the existing diagnostic/report owner. Add the before-upgrade checklist. Thanks @TOM-WANG-GUANG for the report in #166116.
Move the shared failure type and pure destination renderer into the existing leaf formatter. Remove the redundant destination module and include the formatter in the PR wrapper inventory. This removes the type-import cycle and closes extracted runtime imports without changing diagnostic output.
4802682 to
29dd99a
Compare
The target-runtime admission case still exits with code 1, records node-runtime-preflight, and refuses package installation. Its exact output expectation predates the named check and installation diagnostics in #166410. Require the complete current refusal: engines.node, target requirement, detected Node version and executable, resolved install root, entrypoint, Gateway ownership context, and unchanged recovery guidance. Keep every refusal and no-install assertion. Production behavior is unchanged. Validation: both reported update files passed 69 tests on Testbox; 143 update siblings and preflight-owner files passed under their owning configurations. The full infra configuration covered 1,942 files across six Linux partitions. Four AWS worktree cases correctly rejected the 8 GiB tmpfs capacity; all 11 cases passed on disk-backed scratch with the reserve unchanged. Two inherited Doctor warning assertions were fixed upstream by 0dc2091. check-changed, CLI update types, lint, boundary lint, three Knip scans, and P2 review passed. The separate SQLite-spy fix landed upstream in 800fce2 and is not duplicated. No test cases or CI work were added.
…and the detected runtime when refusing (openclaw#166410) Closes openclaw#166116 Reported by @TOM-WANG-GUANG.
The target-runtime admission case still exits with code 1, records node-runtime-preflight, and refuses package installation. Its exact output expectation predates the named check and installation diagnostics in openclaw#166410. Require the complete current refusal: engines.node, target requirement, detected Node version and executable, resolved install root, entrypoint, Gateway ownership context, and unchanged recovery guidance. Keep every refusal and no-install assertion. Production behavior is unchanged. Validation: both reported update files passed 69 tests on Testbox; 143 update siblings and preflight-owner files passed under their owning configurations. The full infra configuration covered 1,942 files across six Linux partitions. Four AWS worktree cases correctly rejected the 8 GiB tmpfs capacity; all 11 cases passed on disk-backed scratch with the reserve unchanged. Two inherited Doctor warning assertions were fixed upstream by bdb02cf. check-changed, CLI update types, lint, boundary lint, three Knip scans, and P2 review passed. The separate SQLite-spy fix landed upstream in f583dd0 and is not duplicated. No test cases or CI work were added.
Closes #166116
What Problem This Solves
Update refusals in multi-install setups can omit the installation selected for the update, the actual Node executable, and the service check that failed. A stale PATH entry then looks like a failure of the running Gateway's installation.
User Impact
Node and managed-service refusals show the named check, required and detected facts, update install and binary paths, inspected Gateway installation, and recovery guidance. Different installation roots receive explicit PATH guidance. The before-upgrade checklist reuses the existing status installation-drift output and JSON fields.
Initial service-manager unavailability remains a best-effort warning. Admission, activation, and rollback decisions are unchanged. Older installed updaters retain their original messages for the first upgrade hop.
Why This Change Was Made
The existing failure-fact owner now builds one diagnostic record with
check,required,detected,installRoot,binaryPath,gatewayInstall, andremedy. Both refusal owners use it, and the existing report formatter renders it. Persisted/exported facts retain their bounds and redaction; complete paths remain available locally. Supported Node requirements and the retained absolute-launcher recovery guidance remain with their existing owners.Production is +160/-73 (+87 net), tests +181/-61, docs +14/-0, and wrapper inventory +1/-0. No config/CLI option, dependency, SQLite schema, or status field was added. Thanks to @TOM-WANG-GUANG for the Windows report and checklist.
Evidence
pre-existing on main, unrelated:
src/infra/update-repair-agent.e2e.test.tsreproduced the validating/verifying repair-turn failures on cleanorigin/mainat3716ea5bf7b2aaaac25b744f9dc6e38fb762a93c: 73.887 s / 69.985 s, zero tool calls,summary: "per-turn-budget",timedOut: true. Authority checks spent approximately 60–65 s re-reading SQLite authority snapshots. The lead assigned this a separate follow-up; no repair-turn code, timeout, or assertion is changed here.Pre-fix regressions failed for the omitted runtime executable and missing service check name. Final touched proof: 7 suites, 116 tests passed, 191.57s wrapper wall time. The final service-root normalization was also checked by both service suites (47 tests). The redaction owner passed all 52 tests; existing status proof passed 12 tests.
node scripts/check-changed.mjspassed, including core/test types, lint, line-cap and other guards. A final incremental core typecheck covers the committed tree. All proof used isolated local state.The synthetic no-plugin runtime-preview fixture no longer discovers bundled plugin backup hooks. Measured test time fell from approximately 131s to 2.44s (wall 257.21s to 20.99s). This preserves real admission and recovery-baseline capture without increasing timeouts or adding retries.
Controlled Windows importer comparison: a clean detached
origin/mainat4aba71cb936a7282235904958a76d36181cb3ee5passed all 21 tests insrc/cli/update-cli.windows-lifecycle.test.ts(164.54s wrapper; interactive triage cases 30.417s/24.513s, task-enable case 3.278s). The same command and worker setting on the pre-trim candidate passed all 21 (195.94s wrapper; 51.256s/41.731s/4.948s). The detached worktree was removed.An earlier multi-file importer run had two 120s timeouts in those interactive triage cases (122.604s/131.490s), followed by an expected-two/observed-zero task-disable assertion. Neither a baseline failure nor a patch-only failure reproduced in the controlled comparison. These original intermittent failures remain disclosed; no Windows lifecycle change or speculative fixture fix is included, and no passing replay is claimed as a fix.
P1 Codex review was unavailable with HTTP 401. Per the campaign ruling, the lead must review the PR head. Auto-merge is off. Hosted CI time is pending at authoring handoff.
CI repair: the failure formatter now imports only types, owns the shared type and destination rendering data, and has no edge back to the producer. The redundant destination module was folded into the leaf and removed; its consumers were migrated. One sorted wrapper-inventory entry closes the runtime extraction. Both closure suites passed (20 tests), owner suites passed (183 tests), Madge reported 0 cycles,
node scripts/check-changed.mjspassed, andpnpm buildpassed. This follow-up adds 2 production lines net and one inventory line.Refusal-result repair: the three Bun-prefix refusals still return
ok: false; the regression was fivefailureFactsentries replacing the original single entry. The Node owner again returns one bounded summary while retaining the complete local error text.Test-edit justification:
update-command-target.n1-prefix.test.tschanges only two error-message strings; its decisions and one-entry fact assertions are unchanged.update-cli.target-schema.test.tschanges one exact log-string argument to include the check, required/detected runtime, installation paths, and unchanged recovery guidance; refusal, no-install, and lookup-count assertions are unchanged.update-command-service-plan.test.tschanges only the expected message to the single summary's redacted detected runtime; its check matcher remains, and the full error still asserts the update binary path. No decision/result-field assertion is removed or weakened.Final refusal-result CI repair validation at
480268250790c58599c6a8b9e5b34cc168ea3c7b:node scripts/run-vitest.mjs src/cli/update-cli/update-command-target.n1-prefix.test.ts src/cli/update-cli/update-command-service-plan.test.ts src/cli/update-cli.target-schema.test.tspassed all 87 tests, including the three reported n1-prefix refusal cases, in 211.10 s wrapper wall time (target-schema: 37 tests / 198.03 s Vitest; n1-prefix and service-plan: 50 tests / 3.98 s).node scripts/check-changed.mjspassed after the commit, including typechecks, lint, and 0 runtime import cycles. The follow-up commit is production +2/-1, tests +8/-4, total +10/-5. A fresh P1 Codex review attempt again returned HTTP 401; no review was produced, and lead review remains required under the campaign ruling.Rebased
480268250790c58599c6a8b9e5b34cc168ea3c7bontoorigin/mainateb1b48c58b61dec3cc273587d44e4f9a7eaa29f9. The only conflict wassrc/cli/update-cli.target-schema.test.ts, against771ce97571fa04ccaf5ca349232eed65aaa4224f—test(core,slack,ui): remove low-value tests (batch d000) (#166389). Kept main's reduced incompatible-runtime test and applied this PR's exact diagnostic text to that retained case; main's other test reductions remain intact.Also incorporated main's
5d4484b6ba69caecde9b78f868829b2fbd09697f—chore(deps): update fs-safe to 0.24.2 (#166457)— unchanged. Refreshed this worktree withpnpm install --frozen-lockfileand verified 0.24.2 before the completed proof. An initial run using the old installed dependency was interrupted and is not counted as proof.git range-diffconfirms the first two PR commits are unchanged and the third differs only in test context/indentation around main's simplified case. No production changes or behavior changes were added beyond the mechanical rebase and upstream changes.Rebased-head proof: all 76 tests passed in 186.34 s wrapper wall time (target-schema: 26 tests / 148.78 s Vitest; n1-prefix and service-plan: 50 tests / 7.64 s), including the three reported n1-prefix refusals. The count reflects main's reduction of target-schema from 37 tests to 26.
Rebased head:
29dd99aaeddc764c0ea4c65fde762f742536cbc1.node scripts/check-changed.mjspassed, including production/test typechecks, lint, and 0 runtime import cycles. Published with an explicit--force-with-leasebound to the previous PR head; auto-merge remains off.