Skip to content

fix(update): report Node compatibility in dry-run previews - #149718

Merged
steipete merged 2 commits into
mainfrom
upd/dryrun-runtime-preflight
Sep 16, 2026
Merged

steipete merged 2 commits into
mainfrom
upd/dryrun-runtime-preflight

Conversation

@steipete

@steipete steipete commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #127414

What Problem This Solves

Package update dry-runs omitted Node compatibility checks, so they advertised update actions that the real update would refuse or run with a replacement Node.

User Impact

Text output and the existing JSON notes now describe the same runtime refusal or managed-Node replacement as real execution. Dry-run keeps its successful preview exit status. Fresh profiles remain untouched; initialized profiles keep their existing skipped-run history behavior.

Why This Change Was Made

The runtime planner now owns selection for previews and real updates, including the stricter running/owned/refreshable-service requirement for already-current packages. Both preview entry points reuse the exact target metadata already fetched. The redundant managed-runtime wrapper and its call-shape-only tests are removed.

Production changes are net +4 lines; tests and test routing are net +127, and documentation is +5. The type-cycle repair adds five lines to the original change for direct imports from the owning types module. There are no new configuration options, CLI options, environment variables, dependencies, or database schemas. Real update admission and mutation authority remain unchanged. Older installed CLIs retain their old preview behavior until updated; candidate code cannot patch a driver's earlier planning step.

Evidence

Built CLI comparison against main 24387d03fd3e73d6ed8bf60d39cbe938540f7ebf used real Node 24.21.0 and 26.8.2, isolated home/state/package paths, a free port, and task-owned npm/service shims. Exact-target metadata was synthetic [email protected] requiring >=26.1.0. The common invocation was update --tag 2026.9.5 --json --yes --timeout 15, with the dry-run/restart modifiers below.

Case Main preview Fixed preview Matching real preflight
--dry-run --no-restart notes: [] Would refuse update: Node 24.21.0 … is incompatible Exit 1, node-runtime-preflight
--dry-run with an owned service and compatible current Node notes: [] Would replace managed gateway service Node … with current Node … Passes runtime admission and reaches the fixture's install guard

All four final-artifact commands preserved the fresh fixture's home and package hashes; native service mutation calls were zero. The fallback real run intentionally stops at the npm install guard, so this is preflight proof, not a completed installation or Gateway restart. The CLI proof was repeated against the finalized build after postbuild rewrote its dynamic import paths. An initialized synthetic profile also produced both runtime notes and its normal dry-run history records, with unchanged package contents and no native service mutations.

  • Regression before the fix: 10 failures for missing runtime notes, with 2 compatible controls passing. The final matrix covers 16 text/JSON cases, including unowned, sealed, and stopped services.
  • 93 focused tests passed across fresh-profile admission, runtime planning, preview behavior, and existing managed-service update flows.
  • pnpm build passed, including declarations, SDK export verification, runtime postbuild checks, and the Control UI build.
  • node scripts/check-changed.mjs and git diff --check passed. The first changed-file run found a test-matrix no-map-spread lint issue; the corrected matrix, targeted lint, and complete gate rerun passed.
  • Codex autoreview: scoped-clean at P1 on committed head 45891068141225ac5fe22fa38eb3e7bced2940dd.

CI import-cycle repair

On head ad4c54173c5fd61abb3d03f37d8644b0455b90f8, ManagedGatewayUpdateVerdict lives in update-command-service-context-types.ts. The service plan, maintenance, and service callers import it directly from that module. The reverse import from context types into the service plan is removed, with no forwarding export or baseline change.

  • The exact architecture gate, pnpm check:architecture, passed: Madge cycles decreased from 1 to 0; runtime-value cycles remain 0.
  • node scripts/check-changed.mjs passed. Focused runtime-preview, service-plan, service-maintenance, and service suites passed: 122 tests, with one existing Linux-only test skipped on macOS.
  • git diff --check passed. Fresh Codex branch autoreview against origin/main was scoped-clean at P1.
  • TypeScript transpilation produced identical JavaScript before and after the repair for all four changed files, preserving the built-CLI behavior proof above.

The previous head's unrelated chat-pane-render.ts max-lines failure (tracked in #149622) and goals-operations.test.ts read-budget failure are being handled separately; this repair does not change those files.

Share runtime selection between dry-run and execution, including already-current service eligibility. Reuse exact target metadata and report runtime refusals or replacement Node in preview notes.

Fixes #127414
@clawsweeper

clawsweeper Bot commented Sep 16, 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 maintainer Maintainer-authored PR labels Sep 16, 2026
@steipete
steipete marked this pull request as ready for review September 16, 2026 05:09
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 Sep 16, 2026
@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 2:04 AM ET / 06:04 UTC (Revision 2).

ClawSweeper review

What this changes

Package update previews now report incompatible Node runtimes or eligible managed-service Node replacements using the same planner as real updates.

Merge readiness

✅ Ready for maintainer review

Keep open: this remains a useful fix for an omission present on current main and v2026.9.4. No actionable correctness or security defect was found, and the latest type-only repair preserves the supplied behavior proof.

Priority: P2
Reviewed head: ad4c54173c5fd61abb3d03f37d8644b0455b90f8

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with relevant CLI proof, meaningful regression coverage, and no blocking findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The supplied built-CLI comparison exercises the shared runtime planner with real Node executables and records corrected refusal/replacement notes for isolated fresh and initialized profiles. It proves the changed preview/preflight contract, with no native service mutations; completed installation is outside that claim.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The supplied built-CLI comparison exercises the shared runtime planner with real Node executables and records corrected refusal/replacement notes for isolated fresh and initialized profiles. It proves the changed preview/preflight contract, with no native service mutations; completed installation is outside that claim.
Evidence reviewed 9 items Current main still omits runtime preview: Fetched main's schema preview performs schema and plugin checks without invoking the package runtime planner; update-command.ts returns the dry-run preview before real runtime admission.
Latest release retains the omission: The GitHub release endpoint identifies v2026.9.4 as published on September 11; its schema-preview source likewise contains no package runtime preflight. Release source was inspected through REST after the local tag lookup was unavailable.
Both previews consume shared runtime decisions: Fresh and initialized preview paths reach the shared schema preflight, which passes exact target metadata and service facts to the runtime planner and appends refusal or replacement notes.
Findings None None.
Security None None.

How this fits together

The update CLI combines package requirements with the installed Gateway service's runtime and ownership information. Its planner supplies compatibility decisions to both preview output and real update admission.

flowchart TD
  A[Update command and options] --> B[Exact package requirements]
  C[Managed service runtime and ownership] --> D[Shared compatibility planner]
  B --> D
  D --> E[Preview notes]
  D --> F[Real update admission]
  E --> G[Text or JSON output]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +4, Tests +127, Docs +5. Total +136 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 8 74 70 +4
Tests 4 167 40 +127
Docs 1 5 0 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 13 246 110 +136

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #127414
Summary: This PR is the implementation candidate for the exact dry-run runtime-preflight omission.

Members:

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

Technical review

Best possible solution:

Keep one runtime-selection owner for preview and execution, preserving existing JSON fields, preview exit status, and profile-history behavior.

Do we have a high-confidence way to reproduce the issue?

Yes: current-main source shows that an incompatible managed Node reaches the preview return before runtime admission. The supplied built-CLI comparison demonstrates the omission on the pinned baseline; this review did not execute current main.

Is this the best way to solve the issue?

Yes: sharing the existing planner and adding messages to existing notes is a narrow repair that avoids a competing compatibility policy or a new JSON field.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9b73eb1e90be.

Labels

Label justifications:

  • P2: This corrects misleading package-update previews without changing installation defaults or introducing a blocked setup path.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The supplied built-CLI comparison exercises the shared runtime planner with real Node executables and records corrected refusal/replacement notes for isolated fresh and initialized profiles. It proves the changed preview/preflight contract, with no native service mutations; completed installation is outside that claim.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied built-CLI comparison exercises the shared runtime planner with real Node executables and records corrected refusal/replacement notes for isolated fresh and initialized profiles. It proves the changed preview/preflight contract, with no native service mutations; completed installation is outside that claim.

Evidence

What I checked:

  • Current main still omits runtime preview: Fetched main's schema preview performs schema and plugin checks without invoking the package runtime planner; update-command.ts returns the dry-run preview before real runtime admission. (src/cli/update-cli/update-command-schema.ts:143, 9b73eb1e90be)
  • Latest release retains the omission: The GitHub release endpoint identifies v2026.9.4 as published on September 11; its schema-preview source likewise contains no package runtime preflight. Release source was inspected through REST after the local tag lookup was unavailable. (src/cli/update-cli/update-command-schema.ts, 3a9d69db306c)
  • Both previews consume shared runtime decisions: Fresh and initialized preview paths reach the shared schema preflight, which passes exact target metadata and service facts to the runtime planner and appends refusal or replacement notes. (src/cli/update-cli/update-command-schema.ts:149, ad4c54173c5f)
  • Fallback eligibility and mutation boundaries preserved: The removed wrapper's restart-and-owned-root condition moves into the planner; already-current execution retains its running, owned, refreshable-service requirement. Service inspection returns before mutation, and the runtime probe uses filtered environment variables and an in-memory SQLite database. (src/cli/update-cli/update-command-service-plan.ts:183, ad4c54173c5f)
  • Behavior proof and its limits: The supplied PR body records built-CLI before/after output using real Node 24.21.0 and 26.8.2 with isolated profiles, synthetic exact-target metadata, and task-owned service/npm shims. Refusal and replacement notes match real admission; fresh-profile hashes remain unchanged, native service mutation calls are zero, and initialized profiles retain skipped-run history. Replacement execution intentionally stops at the install guard, so this proves preview/preflight behavior rather than completed installation. (458910681412)
  • Re-review continuity: The previous completed review had no findings. GitHub's exact-head commit patch changes only type declarations and type imports in four files, supporting reuse of the earlier CLI behavior proof; the supplied body also reports 122 focused tests and a clean architecture gate after this repair. (src/cli/update-cli/update-command-service-context-types.ts:5, ad4c54173c5f)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: 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 (1 earlier review cycle)
  • reviewed 2026-09-16T05:15:03.750Z sha 4589106 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 8330f45 into main Sep 16, 2026
193 of 194 checks passed
@steipete
steipete deleted the upd/dryrun-runtime-preflight branch September 16, 2026 07:34
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 17, 2026
…149718)

* fix(update): preview package Node runtime compatibility

Share runtime selection between dry-run and execution, including already-current service eligibility. Reuse exact target metadata and report runtime refusals or replacement Node in preview notes.

Fixes openclaw#127414

* fixup! fix(update): preview package Node runtime compatibility
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 maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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.

openclaw update --dry-run skips package runtime compatibility preflight

1 participant