Skip to content

refactor: share official runtime install handling - #1004

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/shared-official-runtime-install
Nov 5, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
refactor/shared-official-runtime-install

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Official runtime installation is handled twice in the CLI, making the two entry points harder to maintain consistently.

User Impact

No user-visible change. runtime install and release install retain their own validation messages, host preparation, progress, JSON output, and installed/reused/updated receipts.

Why This Change Was Made

Share the execution and output path through one internal helper using the existing install options. Local-path, URL, and manifest installs remain unchanged. No dependency, version, service, or release-automation changes.

Evidence

  • Independent source review found no behavior regressions.
  • Remote Linux validation: formatting, 41 automatic-release Python tests, 5 native-Gateway Python tests, all-target compilation, all 2,068 Rust cases, doc tests, isolated Cargo install, and version smoke.
  • The supervisor PID-publication test initially missed its five-second observation window. Its exact unchanged retry passed; the unrun suites then passed. No assertions or test conditions were weakened.
  • Existing CLI integration fixtures exercised both commands' install/reuse paths, runtime refresh, JSON installation, and canonical-name errors. Six additional installed-binary checks preserved command-specific selector/name errors.
  • Rust 1.99.1, Node 24.22.1, npm 11.19.1, Python 3.14.4; CI's line-tables-only dev/test debug settings.
  • Native platform, MSRV, npm, and CodeQL checks are covered by PR CI.

@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

🦞👀
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.

@vincentkoc
vincentkoc marked this pull request as ready for review November 5, 2026 10:08
@clawsweeper clawsweeper Bot added P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Nov 5, 2026
@clawsweeper

clawsweeper Bot commented Nov 5, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge.

What this changes

This PR shares official runtime installation and output handling between the runtime and release commands.

Example: Repeat ocm release install --channel stable after installing OpenClaw 2026.3.24.

  • Before: The release handler independently prepares the runtime and prints Using installed runtime stable.
  • After: The shared helper prepares the runtime and prints the same receipt.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-equivalent; execution evidence is reported rather than independently inspectable, and platform test jobs remain in progress.
Proof confidence 🦐 gold shrimp (3/6) This MEMBER-authored PR is outside the ordinary contributor proof gate; its body reports remote CLI fixture coverage and installed-binary validation checks, but supplies no independently inspectable runtime artifact.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-authored direction reduces duplicated orchestration without changing the public interface or expanding scope.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR makes a focused consolidation that is absent from main, with no introduced correctness or security defect found.

Priority: P3
Reviewed head: d44025ed613068fa4c826084d3859f9e176354f1

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The reported installed-binary checks have no inspectable terminal output attached; this maintainer-authored refactor is outside the ordinary contributor proof gate.
Agent review details

How this fits together

CLI handlers validate selectors and pass installation options to RuntimeService, which prepares managed runtime files and returns metadata plus an installed, reused, or updated action for rendering.

flowchart TD
 A[Runtime install command] --> C[Shared install helper]
 B[Release install command] --> C
 C --> D[Host readiness check]
 D --> E[RuntimeService preparation]
 E --> F[Managed runtime store]
 E --> G[JSON or action receipt]
Loading

Technical review

Best possible solution:

Retain this focused extraction with command-specific validation in the callers and installation behavior owned by the existing RuntimeService.

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

There is no reported user-facing bug to reproduce; the pinned main source directly confirms duplicated official-install handling.

Is this the best way to solve the issue?

The helper is a small, appropriate extraction: it uses the existing options type and service owner while preserving validation, output profiles, progress, error propagation, and exit codes.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7abac7dfb8b7.

Provenance checked

  • Official runtime reuse and action selection keeps the original intent (3690f07: The recorded commit purpose is to reuse matching official runtimes during installation; the helper retains the same preparation call and action rendering.)
  • Host readiness preflight keeps the original intent (8f81724: The recorded commit purpose is host doctor preflight checks; the helper preserves the existing check before runtime preparation.)
  • Human action receipts keeps the original intent (5fe6de6: The recorded commit purpose is pretty action receipts across CLI commands; the same render functions, profile, and command example remain.)

Testing

Proof path: none.

Security

None.

Evidence

What I checked:

  • Pinned extraction preserves behavior: Both original handlers perform the same host check, progress operation, RuntimeService call, JSON return, and three-action rendering; the helper preserves their order and arguments while command-specific validation remains in the callers. (src/cli/runtime.rs:262, d44025ed6130)
  • Existing command coverage: Existing fixtures assert release installation and reuse, runtime installation and reuse, channel refresh, canonical-name errors, and host fallback for both command groups; no tests are added or weakened. (tests/release_command_tests.rs:253, d44025ed6130)
  • Original behavior retained: Main-line blame and commit metadata associate reuse with 3690f07, host preflight with 8f81724, and action receipts with 5fe6de6; this extraction retains all three contracts. (src/cli/release.rs:115, 7abac7dfb8b7)
  • Related merged refactor has a separate boundary: refactor: reuse runtime install and CLI output helpers #1000 consolidated RuntimeService installation mechanics and render helpers; its merged main still contains the duplicated CLI execution blocks removed here. (src/runtime/install.rs, 56c3690eb2e5)
  • Discussion and validation status: The complete body reports remote baseline validation and six installed-binary error checks; both comments contain review status only. Head checks show fourteen successes and two running platform test jobs, with no failed check. (d44025ed6130)
  • Policy and inspection limits: Read the complete root AGENTS.md; no nested AGENTS.md, maintainer-note directory, or pr-simplify skill was present. Some older blobs were unavailable locally, limiting historical content inspection; pinned base/head source and relevant blame were readable. No builds or tests were run, and the checkout remains clean. (AGENTS.md:1, d44025ed6130)

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production scope +59 / -72 lines across two CLI files; no test changes The extraction removes thirteen net lines and introduces no new module, dependency, configuration, or persistence format.

Labels

Label changes:

  • add P3: This is internal duplication cleanup with intentionally unchanged user behavior.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is internal duplication cleanup with intentionally unchanged user behavior.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 5, 2026, 5:22 AM ET / 10:22 UTC.

@vincentkoc
vincentkoc merged commit 3d03898 into main Nov 5, 2026
16 checks passed
@vincentkoc
vincentkoc deleted the refactor/shared-official-runtime-install branch November 5, 2026 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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.

1 participant