Skip to content

fix(update): explain missing macOS developer tools when Git is unavailable - #202934

Merged
hannesrudolph merged 2 commits into
openclaw:mainfrom
daniel-lxs:fix/update-macos-git
Nov 22, 2026
Merged

hannesrudolph merged 2 commits into
openclaw:mainfrom
daniel-lxs:fix/update-macos-git

Conversation

@daniel-lxs

@daniel-lxs daniel-lxs commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Related to #202701.

What Problem This Solves

On main, switching a macOS npm install to the dev channel can fail during cloning when the updater selects Apple's Git stub and no developer directory is active. An existing source checkout can be reported as an unmanaged install for the same reason.

User Impact

This PR reports that /usr/bin/git needs the macOS developer tools and stops before invoking the stub. The message tells users to run xcode-select --install or select an installed Xcode, then retry.

Why This Change Was Made

The updater checks the active developer directory when its existing executable search selects /usr/bin/git. The existing search order still gives /usr/bin precedence over inherited PATH entries. Whether the updater should trust a standalone Git is a separate decision for maintainers.

Evidence

Native macOS CLI

Built an npm package directly from PR head 04f1650 and ran its CLI on macOS arm64. For the refusal paths, an OS sandbox hid the Command Line Tools directory from the process. Apple's real selector returned exit 2 while /usr/bin/git remained executable. The pinned main comparison at b4a41aa denied Git execution in its isolated process.

CLI path Pinned main PR head
npm install switching to dev Attempted cloning, then exited 1 with update-failed. Exit 1, git-version-unsupported. No clone step or new checkout.
Update from an existing source checkout Exit 0, skipped as unmanaged-package-install. Exit 1, git-version-unsupported. Checkout HEAD stayed at 04f1650.

The head trial ran these commands.

openclaw update --channel dev --yes --json --no-restart
node ./openclaw.mjs update --yes --json --no-restart

Both refusals printed this message to stderr.

Update refused: /usr/bin/git requires the macOS developer tools. Install the Command Line Tools with xcode-select --install or select an installed Xcode, then retry openclaw update.

With the installed developer tools visible, git version 2.54.0 (Apple Git-157) completed the npm-to-source switch using an existing checkout that tracked a private Git mirror pinned to the PR head. The updater returned status: "ok" with exit 0 and the checkout resolved to 04f16506ea34fa8bf28b38711300c0f1fc0d04b5 after the switch. The head check, package swap, and runtime verification each exited 0.

Released npm updaters

Each published updater installed the package built from 04f1650 with openclaw update --tag head.tgz --yes --json --no-restart. The 9.x extended-stable updater also needed --channel stable to select the local artifact. Each run used an isolated, loopback Gateway and stopped it for the update.

Starting release Exit and installed commit Before/after checks
2026.9.37 (extended-stable) 0, ok, 04f16506ea34 Workboard card 0eee1704-d0dc-4434-85fa-89bea492f31b and its title preserved. Workspace SHA-256 0a6b4676c814… matched. /readyz returned 200 both times.
2026.10.10 (10.x) 0, ok, 04f16506ea34 Workboard card 8cdf8ef3-dd70-415e-8038-295cefe92ea7 and its title preserved. Workspace SHA-256 56a57ab3d0b8… matched. /readyz returned 200 both times.
2026.11.6 (latest stable) 0, ok, 04f16506ea34 Workboard card 8ed50274-09e7-4323-94d4-dbe4cdf4a074 and its title preserved. Workspace SHA-256 64147b95291c… matched. /readyz returned 200 both times.

The cards were read through the Gateway RPC. The CLI returned the same messages.ackReaction value (🧪) and configured workspace path. The 10.x and latest-stable runs retained their stable channel. The 9.x run saved stable as explicitly requested.

Regression tests

The same two test files ran on macOS arm64 with Node 24.22.1. The base was pinned main at b4a41aa with only the two test-file changes applied. The passing run used 2bb9c2ac0, whose Git tree matches signed PR head 04f1650.

node scripts/run-vitest.mjs src/cli/update-cli/update-command-install-layout.test.ts --maxWorkers=1 --reporter=verbose
node scripts/run-vitest.mjs src/infra/update-runner-git-commands.test.ts --maxWorkers=1 --reporter=verbose
Regression Pinned main with the new tests Candidate with the same tests
Source update with no confirmed package owner and missing developer tools 1 failed, 8 passed. The CLI exited 0; the assertion expected { code: 1 }. The test command exited 1. 9/9 passed. The test command exited 0.
macOS system Git with no selected developer directory (selected: false) 1 failed, 6 passed. Git was invoked (true); the assertion expected false. The test command exited 1. 7/7 passed. The test command exited 0.

Full core lint stripe 5 passed locally on macOS arm64 at 04f1650 in 36.44 seconds. Exit 0, 0 errors, and 7 warnings in files outside the PR diff.

@clawsweeper

clawsweeper Bot commented Nov 21, 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 scripts Repository scripts size: M labels Nov 21, 2026
@daniel-lxs
daniel-lxs marked this pull request as ready for review November 21, 2026 04:47
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 21, 2026
@clawsweeper

clawsweeper Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Detects unavailable macOS system Git before checkout discovery or update preparation and explains how to install developer tools.

Example: On macOS without selected developer tools, run openclaw update --channel dev --yes --json --no-restart.

  • Before: The updater invokes Apple’s Git stub and fails during cloning.
  • After: The updater exits with git-version-unsupported, names /usr/bin/git, and recommends xcode-select --install before retrying.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, focused repair with native behavior evidence, preserved-state upgrade results, distinct regressions, and passing current-head gates.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Native macOS CLI output at 04f1650 exercises npm-to-dev and existing-checkout refusals before Git invocation, plus successful switching with developer tools available; the merge adaptation was inspected against the newer release owner.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: macOS updates can invoke Apple’s unavailable Git stub or misclassify a source checkout without explaining the missing prerequisite.
Reason: The linked report explicitly accepts naming the unusable executable before starting, and this maintainer-authored PR selects that bounded repair.

Merge readiness

✅ Ready for maintainer review

This PR provides an actionable macOS Git prerequisite refusal while preserving executable precedence; no actionable defects remain, and the current head’s CI gates pass.

Priority: P2
Reviewed head: 600793afabd0ebadcec719a45d7995c91e2273f4

Before merge

None.

Findings

None.

Agent review details

How this fits together

Update discovery classifies the installation, and CLI or Gateway preparation checks prerequisites before selecting and staging a release.

flowchart TD
  A[Update request] --> B[Installation discovery]
  B --> C[Shared macOS Git probe]
  C --> D[Package ownership check]
  D --> E[Actionable prerequisite refusal]
  D --> F[Existing update preparation]
Loading

Technical review

Best possible solution:

Use the shared prerequisite probe across discovery and update admission while retaining existing executable precedence and package ownership.

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

Current-main source retains the reported failure path, supported by the author’s controlled native macOS comparisons; this review executed no target code.

Is this the best way to solve the issue?

The smallest complete repair is an executable-specific prerequisite diagnosis shared by existing owners; the reused helper and distinct CLI regression cover that boundary without changing Git selection.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 186b5b1548e6.

Provenance checked

  • Git prerequisite refusal keeps the original intent (764761e: Refuse known unsupported Git before staging and name the executable actually selected by the updater.)
  • Checkout discovery keeps the original intent (4dc04b1: Avoid unnecessary Git probes for packages while preserving checkout metadata, explicit Git ownership, cancellation, and timeout handling.)
  • Unmanaged installation reporting changes intended behavior with a stated reason (90621d0: Unsupported installations are successful non-outcomes; this PR distinguishes an identifiable checkout whose Git prerequisite is unavailable.)
  • Prepared-release update admission keeps the original intent (689d524: Share release preparation between CLI and Gateway while keeping the serving Gateway running.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Pinned change and shared probe: The introduced diff centralizes detection in a reused helper that checks the selected executable and invokes xcode-select before Apple’s Git stub. (src/infra/update-macos-git.ts:4, 600793afabd0)
  • Current main still needs the repair: Current main invokes Git during checkout discovery and treats unsuccessful Git version probes as providing no prerequisite refusal. (src/infra/update-check.ts:266, 186b5b1548e6)
  • Release-update integration: The merge adaptation checks unavailable system Git before release-owner discovery and preserves confirmed package ownership when reporting an unowned checkout. (src/update/run.ts:164, 600793afabd0)
  • Native behavior and upgrade evidence: The complete PR body supplies macOS arm64 CLI results for both refusal paths, successful switching with developer tools available, red-before/green-after regressions, and upgrades from 2026.9.37, 2026.10.10, and 2026.11.6 preserving settings, workspace contents, and Workboard cards. (600793afabd0)
  • Existing executable policy preserved: The merged Prefer non-user writeable paths #54346 established system-directory precedence; its discussion records the merge decision, and this PR leaves that policy intact. (src/infra/path-env.ts, c40884d306e8)
  • Current-head gates and mergeability: The reviewed head has successful aggregate CI and lint checks, resolving the previous review’s rank-up request; the live PR response reports a clean merge. (600793afabd0)

Likely related people:

  • Ayaan Zaidi: Raw commit 764761e adds src/infra/update-runner-git-commands.ts:37 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 764761ee6450; files: src/infra/update-runner-git-commands.ts)
  • Peter Steinberger: Raw commit 4dc04b1 adds src/infra/update-check.ts:254 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 4dc04b14f0bf; files: src/infra/update-check.ts)

PR surface

Source +76, Tests +52, Docs +4, Other +93. Total +225 across 12 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 7 90 14 +76
Tests 3 52 0 +52
Docs 1 4 0 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 1 93 0 +93
Total 12 239 14 +225

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.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: Repairs misleading failures in a specific macOS source-update CLI workflow without establishing a general update outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

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.

History

Review history (3 earlier review cycles)
  • reviewed 2026-11-21T05:04:57.010Z sha 04f1650 :: needs maintainer review before merge. :: none
  • reviewed 2026-11-21T06:26:53.671Z sha 04f1650 :: needs maintainer review before merge. :: none
  • reviewed 2026-11-21T07:07:27.005Z sha 04f1650 :: needs maintainer review before merge. :: none

Reviewed November 22, 2026, 5:11 PM ET / 22:11 UTC (Revision 4).

@daniel-lxs

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@daniel-lxs

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Nov 21, 2026
@daniel-lxs

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Nov 22, 2026
@hannesrudolph
hannesrudolph merged commit 4097bc6 into openclaw:main Nov 22, 2026
129 checks passed
tideclaw-bot pushed a commit that referenced this pull request Nov 24, 2026
…tate database (#203578)

* fix(update): refuse migrating updates while a node service keeps the state open

Refs #203457

* docs(update): explain the node-service migration refusal

Refs #203457

* fix(update): match the node service's own state directory by filesystem identity

A default node service omits the state selector and must not inherit the updater's; path aliases name one directory. Refs #203457

* fix(update): refuse every activation while a node service keeps the state open

Update Doctor takes native exclusion of openclaw.sqlite on every activation, including patch updates without a schema change (#203457 reported 2026.11.5 -> 2026.11.6, both schema 36). Refuse whenever a running, kind-marked node service resolves to the same state directory, not only for pending migrations. Refs #203457

Co-authored-by: Peter Steinberger <[email protected]>
(cherry picked from commit 19fcba1)

Release adaptation: retain stable captureUpdateActivationSchemas destructuring and check node ownership only before first mutation, so Git revalidation after mutation does not report a pre-mutation refusal. Keep stable preparatory staging and check before any Gateway stop or installed activation.

Release adaptation: keep only the node-service docs and regression in the conflict regions; the separate Gateway migration admission (#203170) is not a prerequisite and remains outside the lane.

Companion audit: no later PR or SHA mentions through 665c286. #203497 (future package preparation) is not needed; the existing stable package/Git activation hooks already share the pre-stop boundary. #203981 is selected elsewhere and already present at lane base (f6ad5b5). Later #204275, #204253, #204224, #204127, #204094, #204095, #204151, #204054, #203994, #203990, #203917, #203959, #203926, #203925, #203915, #203914, #202934 and #203735 are not applicable as companions: independent Git, rollback, Doctor/recovery, plugin, output, docs and host changes do not supply or consume node-service admission.

Validation: two same-state activation cases red on f6ad5b5 (wrongly reached mutation), three controls passed; all 73 tests in update-command-execution.test.ts passed with the fix.

Co-authored-by: RomneyDa <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 24, 2026
…01978)

* fix(update): copy original state only at the first state change

* docs(update): say when the original-state capture is taken

* fix(update): copy before a Gateway handoff, legacy config repair, or a fresh post-core process

* test(update): expect the copy before a fresh post-core process

* test(update): prove real Git and release updates copy at their mutation hook

* fix(update): copy after the last pre-stop refusal and before writing a changed channel

* test(update): a refused update copies nothing; sort run ids with a comparator

* fix(update): copy before plugin records publish, outside the update deadline, and only once a handoff is certain

* fix(update): copy before the combined plugin index write, every channel write and a fresh post-core launch, outside every update clock

* fix(update): let the lazy capture follow this run's prepared package publication

* test(update): drive the Git no-op capture case through the release runner

* style(test): sort merged imports

Release adaptation: Keep stable’s in-place Git runner and its existing service and rollback paths. Route the Git no-op fixture through updateGitCheckout and retain the before-mutation capture assertions. Omit the prepared Git release branch and its release-link-only tests. Merge the Doctor and fresh-handoff timing checks alongside the stable-only handoff coverage. Stable arms the executor clock before already-current package maintenance; keep both its timer and its synchronous fence/SQLite deadline checks paused during separately bounded capture. Exercise a live fence assertion after the original activation deadline elapses inside excluded work.

Companion audit: #203578 is present-equivalent at e396e3f; its stable state-ownership guard is preserved. #203194, #203497 and #203926 apply to main’s newer release staging/activation flow and are not applicable here. #204127 changes when plugins are installed after activation, #203917 concerns retained-runtime cleanup, #202934 adds a separate macOS Git prereq, and #204151 is independent handoff repair guidance. None is required for lazy original-state capture.

(cherry picked from commit a577911)
Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 1a2e6a7bec75074a150a684848990710c3fddc48)
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 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. scripts Repository scripts 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.

2 participants