Repository navigation
fix(update): explain missing macOS developer tools when Git is unavailable - #202934
Conversation
|
🦞👀 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. What this changesDetects 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.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete 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 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherUpdate 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]
Technical reviewBest 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
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +76, Tests +52, Docs +4, Other +93. Total +225 across 12 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (3 earlier review cycles)Reviewed November 22, 2026, 5:11 PM ET / 22:11 UTC (Revision 4). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…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]>
…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)
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/gitneeds the macOS developer tools and stops before invoking the stub. The message tells users to runxcode-select --installor 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/binprecedence 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
04f1650and 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 exit2while/usr/bin/gitremained executable. The pinned main comparison atb4a41aadenied Git execution in its isolated process.1withupdate-failed.1,git-version-unsupported. No clone step or new checkout.0, skipped asunmanaged-package-install.1,git-version-unsupported. Checkout HEAD stayed at04f1650.The head trial ran these commands.
Both refusals printed this message to stderr.
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 returnedstatus: "ok"with exit0and the checkout resolved to04f16506ea34fa8bf28b38711300c0f1fc0d04b5after the switch. The head check, package swap, and runtime verification each exited0.Released npm updaters
Each published updater installed the package built from
04f1650withopenclaw update --tag head.tgz --yes --json --no-restart. The 9.x extended-stable updater also needed--channel stableto select the local artifact. Each run used an isolated, loopback Gateway and stopped it for the update.2026.9.37(extended-stable)0,ok,04f16506ea340eee1704-d0dc-4434-85fa-89bea492f31band its title preserved. Workspace SHA-2560a6b4676c814…matched./readyzreturned200both times.2026.10.10(10.x)0,ok,04f16506ea348cdf8ef3-dd70-415e-8038-295cefe92ea7and its title preserved. Workspace SHA-25656a57ab3d0b8…matched./readyzreturned200both times.2026.11.6(latest stable)0,ok,04f16506ea348ed50274-09e7-4323-94d4-dbe4cdf4a074and its title preserved. Workspace SHA-25664147b95291c…matched./readyzreturned200both times.The cards were read through the Gateway RPC. The CLI returned the same
messages.ackReactionvalue (🧪) 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
b4a41aawith only the two test-file changes applied. The passing run used2bb9c2ac0, whose Git tree matches signed PR head04f1650.0; the assertion expected{ code: 1 }. The test command exited1.0.selected: false)true); the assertion expectedfalse. The test command exited1.0.Full core lint stripe 5 passed locally on macOS arm64 at
04f1650in 36.44 seconds. Exit0, 0 errors, and 7 warnings in files outside the PR diff.