Skip to content

feat(claws): make openclaw update-ox.sh actually upgrade ox#600

Merged
galexy merged 3 commits into
mainfrom
worktree-openclaw-ox-update-actually-upgrades
May 11, 2026
Merged

feat(claws): make openclaw update-ox.sh actually upgrade ox#600
galexy merged 3 commits into
mainfrom
worktree-openclaw-ox-update-actually-upgrades

Conversation

@galexy
Copy link
Copy Markdown
Contributor

@galexy galexy commented May 11, 2026

Summary

  • The update-ox.sh script in claws/openclaw/sageox-distill and claws/openclaw/sageox-summary was a misleadingly named readiness gate, not an updater. Its own header said so: "The curl install path has no per-run update — users re-run install-ox-curl.sh to bump the pinned release." It only verified the installed binary matched the version pin already recorded in ~/.openclaw/memory/sageox-ox-install.json. As a result, after a clawhub install of a refreshed skill, users would either keep the stale install (state file matched) or get a hard exit 2 with a "run the install flow from references/INSTALL.md" hint — they had to manually re-enter the install flow to pick up the new pinned release.
  • Rewrites update-ox.sh so the install actually catches up to the skill's pin on every run. The script now reads OX_INSTALL_REF from the sibling install-ox-curl.sh (the source of truth, with its OX_INSTALL_REF and per-platform sha256s reviewed at skill publish), compares against the installed binary's ox version, and re-invokes install-ox-curl.sh to upgrade in place when they differ. New exit code 3 covers "upgrade attempted but install-ox-curl.sh failed."
  • Bumps the pin from v0.6.4 (April release) to v0.7.2 (the actual latest, May 4) with sha256 constants taken from the v0.7.2 checksums.txt asset. Bumps skill versions: sageox-distill 0.2.1 → 0.3.0, sageox-summary 0.3.1 → 0.4.0. Updates SKILL.md and references/INSTALL.md in both skills to describe the new install-and-update gate and new exit code.

Motivation

The pin-then-publish supply-chain model stays intact — there's still no dynamic "latest" resolution from the internet, and an attacker still can't substitute a different binary without editing install-ox-curl.sh (which is reviewed on skill publish). What changes is that drift between "skill ships a new pinned version" and "the installed binary catches up" closes automatically, instead of requiring the user to manually re-enter the install flow each time the skill bumps OX_INSTALL_REF.

What's in the change

File (× both skills) Change
scripts/install-ox-curl.sh OX_INSTALL_REF v0.6.4v0.7.2; all 5 OX_SHA256_* constants replaced with values from v0.7.2 checksums.txt.
scripts/update-ox.sh Rewritten as install-and-update gate. Reads pin from sibling install-ox-curl.sh, re-runs it in place on drift. Adds exit 3. Stays byte-identical between distill and summary.
SKILL.md Skill version bumped (distill 0.3.0, summary 0.4.0). § 3 "Installing ox" describes the new gate, documents exit codes including the new 3, drops the "no per-run auto-update" paragraph.
references/INSTALL.md "Upgrading ox" section rewritten to describe the new auto-converge behavior.

Flow

flowchart TD
    A[skill invokes bash scripts/update-ox.sh] --> B{state file exists?}
    B -- no --> X1[exit 2 — run install flow]
    B -- yes --> C{~/.local/bin/ox executable?}
    C -- no --> X1
    C -- yes --> D{command -v ox resolves to pinned path?}
    D -- no --> X2[exit 2 — fix PATH]
    D -- yes --> E[read OX_INSTALL_REF from install-ox-curl.sh]
    E --> F[run ox version]
    F --> G{first line == 'ox skill_version'?}
    G -- yes --> Z0[exit 0 — already current]
    G -- no --> H[bash install-ox-curl.sh — upgrade in place]
    H --> I{install ok?}
    I -- yes --> Z0b[exit 0 — upgraded]
    I -- no --> X3[exit 3 — surface stderr]
Loading

Test plan

  • bash -n syntax-checked both rewritten update-ox.sh files.
  • Pin-extraction regex against the updated install-ox-curl.sh produces v0.7.2.
  • diff -q confirms scripts and INSTALL.md stayed byte-identical across both skills.
  • clawhub-skill-lint PASSED both skills (0 critical, 0 warnings, 0 info).
  • Manual end-to-end on a machine with a pre-existing ~/.local/bin/ox at v0.6.4: confirm update-ox.sh triggers the in-place download and the state file rewrites to v0.7.2.
  • Manual fresh-install path on a machine with no ~/.local/bin/ox: confirm exit 2 still kicks the user to references/INSTALL.md.
  • Throwaway-slug ClawHub publish for both skills before promoting to the canonical slugs.

Summary by CodeRabbit

  • New Features

    • Automatic ox version convergence on each run; installer will upgrade/downgrade when installed version differs from the pinned release.
    • Voice command "reinstall ox" to force reinstallation.
  • Chores

    • Bumped bundled ox from v0.6.4 to v0.7.2 and updated platform checksums.
    • Updated installation/upgrade docs and exit-code contract for clearer behavior.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 456a0aac-a9ee-424c-8a0e-61f3cc801631

📥 Commits

Reviewing files that changed from the base of the PR and between fd11c77 and 3bf7270.

📒 Files selected for processing (2)
  • claws/openclaw/sageox-distill/scripts/update-ox.sh
  • claws/openclaw/sageox-summary/scripts/update-ox.sh
🚧 Files skipped from review as they are similar to previous changes (2)
  • claws/openclaw/sageox-summary/scripts/update-ox.sh
  • claws/openclaw/sageox-distill/scripts/update-ox.sh

📝 Walkthrough

Walkthrough

Both sageox-distill and sageox-summary pin ox to v0.7.2 (new checksums), refactor update-ox.sh to derive the pin from install-ox-curl.sh and auto-invoke the installer on version drift, and update SKILL.md/INSTALL.md to document the new behavior and exit codes.

Changes

Ox Auto-Upgrade Implementation

Layer / File(s) Summary
Skill Version Increments
claws/openclaw/sageox-distill/SKILL.md, claws/openclaw/sageox-summary/SKILL.md
Front-matter versions bumped: distill 0.2.1 → 0.3.0; summary 0.3.1 → 0.4.0.
Ox Release Pin and Checksums
claws/openclaw/sageox-distill/scripts/install-ox-curl.sh, claws/openclaw/sageox-summary/scripts/install-ox-curl.sh
OX_INSTALL_REF updated to v0.7.2 and platform-specific OX_SHA256_* checksums replaced for darwin, linux, and freebsd architectures.
Distill Auto-Upgrade Logic
claws/openclaw/sageox-distill/scripts/update-ox.sh
Now locates sibling install-ox-curl.sh, reads OX_INSTALL_REF, derives skill_version, runs the pinned binary to get its version, and re-runs the installer on mismatch. Exit codes: 0 success, 2 missing/unreadable pin or runnable binary failure, 3 installer failure during drift remediation.
Summary Auto-Upgrade Logic
claws/openclaw/sageox-summary/scripts/update-ox.sh
Same refactor: require install-ox-curl.sh, extract OX_INSTALL_REF, compare installed ox version, and invoke installer on mismatch with identical exit-code semantics.
Distill Documentation & Contracts
claws/openclaw/sageox-distill/SKILL.md, claws/openclaw/sageox-distill/references/INSTALL.md
Rewrote "Installing ox" text and INSTALL.md to document pin source, per-run update check, in-place upgrade behavior, exit-code meanings, and "reinstall ox" escape hatch.
Summary Documentation & Contracts
claws/openclaw/sageox-summary/SKILL.md, claws/openclaw/sageox-summary/references/INSTALL.md
Rewrote installation docs to describe invoking scripts/update-ox.sh each run, pin derivation from install-ox-curl.sh, exit-code contract, skill-version thresholds, and manual reinstall instructions.

Sequence Diagram

sequenceDiagram
  participant Client as update-ox.sh
  participant Installer as install-ox-curl.sh
  participant Ox as $HOME/.local/bin/ox
  Client->>Installer: read OX_INSTALL_REF
  Client->>Ox: execute "ox version"
  Ox-->>Client: returns version string
  Client->>Client: compare installed vs pinned
  alt match
    Client->>Client: exit 0
  else mismatch
    Client->>Installer: invoke installer to upgrade/downgrade
    alt installer succeeds
      Client->>Client: exit 0
    else installer fails
      Client->>Client: exit 3
    end
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • sageox/ox#516: Modifies the same install/update scripts and docs (install-ox-curl.sh, update-ox.sh, INSTALL.md, SKILL.md); related to pin/checksum and update behavior changes.
  • sageox/ox#511: Earlier changes to install/update flow and docs that overlap with the update-ox.sh refactor and pin handling.
  • sageox/ox#548: Also updates install-ox-curl.sh pins and platform SHA256 checksum constants for a new ox release.

Poem

🐰 A rabbit’s ode to automatic ox
Pinned and checked, the checksum hums,
Version read, the installer runs,
Drift detected—upgrade begun,
Quiet gardens, no more re-runs.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: rewriting update-ox.sh to actively upgrade the ox binary when versions differ, which is the core objective of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch worktree-openclaw-ox-update-actually-upgrades

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@claws/openclaw/sageox-summary/scripts/update-ox.sh`:
- Around line 78-85: The skill_pin extraction can fail under set -euo pipefail
because grep returning non-zero will cause an early exit before the subsequent
empty-check; modify the extraction so the pipeline never returns a non-zero
status (e.g., append "|| true" to the grep pipeline or capture the pipeline with
a conditional assignment) when computing skill_pin from INSTALL_SCRIPT using the
OX_INSTALL_REF pattern, and keep the existing empty-check that echoes the error
and exits with code 2 (ensure the symbols skill_pin, INSTALL_SCRIPT and the
OX_INSTALL_REF pattern are used unchanged).

In `@claws/openclaw/sageox-summary/SKILL.md`:
- Around line 112-125: The "Stderr" contract in SKILL.md incorrectly asserts
failures are exactly two lines; update the Stderr bullet to say callers must
surface stderr verbatim (may be one or many lines) and remove the "two-line"
wording so it matches actual output from scripts like scripts/update-ox.sh
(which can emit single-line or multi-line stderr including command stderr). Edit
the Stderr bullet in SKILL.md to state: on any failure, surface the script's
stderr output verbatim (no assumption about line count) and, if helpful, call
out that callers should not trim or reformat the stderr before presenting it to
the user.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4ea08b68-70f2-40ea-98ae-e0257913b5df

📥 Commits

Reviewing files that changed from the base of the PR and between 716881e and c519792.

📒 Files selected for processing (8)
  • claws/openclaw/sageox-distill/SKILL.md
  • claws/openclaw/sageox-distill/references/INSTALL.md
  • claws/openclaw/sageox-distill/scripts/install-ox-curl.sh
  • claws/openclaw/sageox-distill/scripts/update-ox.sh
  • claws/openclaw/sageox-summary/SKILL.md
  • claws/openclaw/sageox-summary/references/INSTALL.md
  • claws/openclaw/sageox-summary/scripts/install-ox-curl.sh
  • claws/openclaw/sageox-summary/scripts/update-ox.sh

Comment thread claws/openclaw/sageox-summary/scripts/update-ox.sh Outdated
Comment thread claws/openclaw/sageox-summary/SKILL.md Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@claws/openclaw/sageox-distill/scripts/update-ox.sh`:
- Around line 25-27: The stderr contract comment in update-ox.sh is too
strict—change the header on/around the Stdout/Stderr block so it no longer
claims stderr is always a "one-line" signal; reword it to indicate stderr will
typically be a single-line diagnostic but may emit short multi-line messages
(e.g., on the failure paths around the code that currently emits multi-line
output at the blocks near lines referencing the install/upgrade failures and the
install-ox-curl.sh calls). Update the wording referencing install-ox-curl.sh so
tests/docs expect one-line or short multi-line diagnostics rather than a hard
single-line guarantee.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: eb58ede5-0d2a-4417-9ad5-5c00e1c07909

📥 Commits

Reviewing files that changed from the base of the PR and between c519792 and fd11c77.

📒 Files selected for processing (4)
  • claws/openclaw/sageox-distill/SKILL.md
  • claws/openclaw/sageox-distill/scripts/update-ox.sh
  • claws/openclaw/sageox-summary/SKILL.md
  • claws/openclaw/sageox-summary/scripts/update-ox.sh
🚧 Files skipped from review as they are similar to previous changes (3)
  • claws/openclaw/sageox-summary/SKILL.md
  • claws/openclaw/sageox-distill/SKILL.md
  • claws/openclaw/sageox-summary/scripts/update-ox.sh

Comment thread claws/openclaw/sageox-distill/scripts/update-ox.sh Outdated
@galexy galexy merged commit 6df6760 into main May 11, 2026
3 checks passed
@galexy galexy deleted the worktree-openclaw-ox-update-actually-upgrades branch May 11, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant