Repository navigation
fix(update): report Node compatibility in dry-run previews - #149718
Conversation
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
|
🦞👀 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 maintainer review before merge. Reviewed September 16, 2026, 2:04 AM ET / 06:04 UTC (Revision 2). ClawSweeper reviewWhat this changesPackage 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 Review scores
Verification
How this fits togetherThe 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]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +4, Tests +127, Docs +5. Total +136 across 13 files. View PR surface stats
Review metricsNone. 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 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
…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
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
notesnow 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
24387d03fd3e73d6ed8bf60d39cbe938540f7ebfused 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 wasupdate --tag 2026.9.5 --json --yes --timeout 15, with the dry-run/restart modifiers below.--dry-run --no-restartnotes: []Would refuse update: Node 24.21.0 … is incompatiblenode-runtime-preflight--dry-runwith an owned service and compatible current Nodenotes: []Would replace managed gateway service Node … with current Node …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.
pnpm buildpassed, including declarations, SDK export verification, runtime postbuild checks, and the Control UI build.node scripts/check-changed.mjsandgit diff --checkpassed. The first changed-file run found a test-matrixno-map-spreadlint issue; the corrected matrix, targeted lint, and complete gate rerun passed.45891068141225ac5fe22fa38eb3e7bced2940dd.CI import-cycle repair
On head
ad4c54173c5fd61abb3d03f37d8644b0455b90f8,ManagedGatewayUpdateVerdictlives inupdate-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.pnpm check:architecture, passed: Madge cycles decreased from 1 to 0; runtime-value cycles remain 0.node scripts/check-changed.mjspassed. Focused runtime-preview, service-plan, service-maintenance, and service suites passed: 122 tests, with one existing Linux-only test skipped on macOS.git diff --checkpassed. Fresh Codex branch autoreview againstorigin/mainwas scoped-clean at P1.The previous head's unrelated
chat-pane-render.tsmax-lines failure (tracked in #149622) andgoals-operations.test.tsread-budget failure are being handled separately; this repair does not change those files.