Skip to content

fix(update): name the failing preflight check, the resolved install, and the detected runtime when refusing - #166410

Merged
steipete merged 3 commits into
mainfrom
upd/upd-preflight-refusal-names-check
Oct 7, 2026
Merged

steipete merged 3 commits into
mainfrom
upd/upd-preflight-refusal-names-check

Conversation

@steipete

@steipete steipete commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

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, and remedy. 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.ts reproduced the validating/verifying repair-turn failures on clean origin/main at 3716ea5bf7b2aaaac25b744f9dc6e38fb762a93c: 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.mjs passed, 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/main at 4aba71cb936a7282235904958a76d36181cb3ee5 passed all 21 tests in src/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.mjs passed, and pnpm build passed. 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 five failureFacts entries 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.ts changes only two error-message strings; its decisions and one-entry fact assertions are unchanged. update-cli.target-schema.test.ts changes 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.ts changes 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.ts passed 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.mjs passed 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 480268250790c58599c6a8b9e5b34cc168ea3c7b onto origin/main at eb1b48c58b61dec3cc273587d44e4f9a7eaa29f9. The only conflict was src/cli/update-cli.target-schema.test.ts, against 771ce97571fa04ccaf5ca349232eed65aaa4224f — 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 with pnpm install --frozen-lockfile and 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-diff confirms 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.mjs passed, including production/test typechecks, lint, and 0 runtime import cycles. Published with an explicit --force-with-lease bound to the previous PR head; auto-merge remains off.

@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes size: M labels Oct 7, 2026
@steipete
steipete marked this pull request as ready for review October 7, 2026 03:06
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 29dd99aaeddc764c0ea4c65fde762f742536cbc1
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/logging/diagnostic-support-redaction.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 7, 2026
@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed October 7, 2026, 2:35 AM ET / 06:35 UTC (Revision 4).

ClawSweeper review

What this changes

The 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
Reviewed head: 480268250790c58599c6a8b9e5b34cc168ea3c7b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable diagnostics improvement with useful regression coverage and no concrete correctness finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The verified maintainer author is exempt from the external-contributor proof gate. Reported owner-path tests cover Node refusals, service inspection loss, installation mismatch, and sanitized reporting; they are supplemental test evidence, not a real-install demonstration. No stored schema or compatibility contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The verified maintainer author is exempt from the external-contributor proof gate. Reported owner-path tests cover Node refusals, service inspection loss, installation mismatch, and sanitized reporting; they are supplemental test evidence, not a real-install demonstration. No stored schema or compatibility contract changes.
Evidence reviewed 8 items Pinned introduced changes: Reviewed the merge-base-to-head changes rather than endpoint drift. The actual checkout and original PR head are 480268250790c58599c6a8b9e5b34cc168ea3c7b; no pinned test merge is available.
One diagnostic owner: The existing failure-fact module builds complete local text and separately passes recorded facts through the existing redaction and length bounds. Destination formatting moves into the existing leaf formatter, and runtime consumers migrate together.
Node refusal result preserved: The final head retains the existing failed Result and one Node failure fact while exposing the full diagnostic through error text. Recovery steps and admission predicates remain intact.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

  • Complete next step (P2) - Resolve the reported merge conflicts, then validate the affected refusal, redaction, and wrapper-import paths on the resulting head.
Agent review details

Security

None.

PR surface

Source +87, Tests +120, Docs +14, Other +1. Total +222 across 24 files.

View PR surface stats
Area Files Added Removed Net
Source 12 160 73 +87
Tests 9 181 61 +120
Docs 2 14 0 +14
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 0 +1
Total 24 356 134 +222

Review metrics

Metric Value Why it matters
Production versus test growth production +160/-73, tests +181/-61 The net production growth is explained by shared refusal diagnostics and redaction support, with no new configuration option or schema.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #166116
Summary: This PR is the explicit implementation candidate for the reported multi-install refusal diagnostics.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best 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.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This improves actionable update diagnostics without changing which updates are admitted or refused.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The verified maintainer author is exempt from the external-contributor proof gate. Reported owner-path tests cover Node refusals, service inspection loss, installation mismatch, and sanitized reporting; they are supplemental test evidence, not a real-install demonstration. No stored schema or compatibility contract changes.

Evidence

What I checked:

  • Pinned introduced changes: Reviewed the merge-base-to-head changes rather than endpoint drift. The actual checkout and original PR head are 480268250790c58599c6a8b9e5b34cc168ea3c7b; no pinned test merge is available. (480268250790)
  • One diagnostic owner: The existing failure-fact module builds complete local text and separately passes recorded facts through the existing redaction and length bounds. Destination formatting moves into the existing leaf formatter, and runtime consumers migrate together. (src/infra/update-failure-facts.ts:41, 480268250790)
  • Node refusal result preserved: The final head retains the existing failed Result and one Node failure fact while exposing the full diagnostic through error text. Recovery steps and admission predicates remain intact. (src/cli/update-cli/update-command-runtime-preflight.ts:307, 480268250790)
  • Public redaction boundary: The new public summary discards the executable path, validates package/runtime versions through the existing public-version owner, restricts runtime requirements to a narrow character grammar, and retains the 200-character bound. (src/logging/diagnostic-support-redaction.ts:497, 480268250790)
  • Still necessary on current main: Fetched main retains the older Node refusal text and the older service revalidation message. Existing status installation-drift reporting supplies the checklist's comparison surface, but does not replace these refusal diagnostics. (src/cli/update-cli/update-command-runtime-preflight.ts, eb1b48c58b61)
  • Live merge state: GitHub confirms the pinned head remains open and unmerged, with mergeable=false and mergeable_state=dirty. This establishes a conflict-resolution prerequisite, not evidence that merging would delete main-only behavior. (480268250790)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-10-07T03:16:35.604Z sha 41f5fa1 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-07T04:32:36.549Z sha c715fc72de85442ac8f97b9170c79fc10b4ed902 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-07T06:12:32.264Z sha c715fc72de85442ac8f97b9170c79fc10b4ed902 :: needs maintainer review before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Oct 7, 2026
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.
@steipete
steipete force-pushed the upd/upd-preflight-refusal-names-check branch from 4802682 to 29dd99a Compare October 7, 2026 07:00
@steipete
steipete merged commit eebfed7 into main Oct 7, 2026
137 checks passed
@steipete
steipete deleted the upd/upd-preflight-refusal-names-check branch October 7, 2026 07:10
steipete added a commit that referenced this pull request Oct 7, 2026
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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 8, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 8, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts security-sensitive-changed size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[docs] Upgrade preflight in multi-install setups doesn't say which install/binary it resolved

1 participant