Repository navigation
fix(update): preserve Homebrew service paths - #154494
Conversation
Backport the Homebrew updater ownership and stable opt-path repair from upstream PR #141011 / commit 8db38db. Co-authored-by: Max Xu <[email protected]>
|
🦞👀 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 21, 2026, 2:30 AM ET / 06:30 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch gives Homebrew installations actionable update guidance and generates stable Homebrew paths for Gateway and node services. Merge readiness✅ Ready for maintainer review No blocking findings. This remains a useful extended-stable backport despite the upstream fix on main; the previous data-model migration blocker is unsupported by the diff. Priority: P2 Review scores
Verification
How this fits togetherThe updater identifies which package manager owns an installation before replacing files. Service installation separately builds the executable arguments saved in operating-system service definitions; both paths now share Homebrew package detection. flowchart TD
A[Installed package path] --> B[Homebrew layout and prefix check]
B --> C[Update command]
C --> D[Homebrew upgrade guidance]
B --> E[Stable opt entrypoint]
E --> F[Gateway and node service arguments]
B --> G[Existing handling for other installations]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +38, Tests +90, Docs +16. Total +144 across 6 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: 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 Homebrew responsible for package replacement and use one formula-path resolver for update guidance and both service types, with documented repair for older service definitions. Do we have a high-confidence way to reproduce the issue? Yes, for the targeted release base: its service argument owner retains versioned Cellar entrypoints and its updater lacks Homebrew guidance. Source and reported pre-fix regressions establish the path; this review did not execute it, and current main already contains the upstream repair. Is this the best way to solve the issue? Yes. A shared formula resolver repairs both service producers and update detection without duplicating platform serializers or importing main's newer updater contracts; reusing the Node-only resolver would conflate distinct package layouts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 67e53329fa72. 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)
|
|
ClawSweeper rank-up move disposition for reviewed head
No migration can or should be added for this code-only owner-boundary repair. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
🦞👀 Re-review progress:
|
Related: #141011
What Problem This Solves
Fixes an issue where users updating a Homebrew formula installation from the 2026.7 train to 2026.8.33 would receive the generic “could not determine global package manager” refusal from
openclaw update. It also prevents newly installed or refreshed Gateway and node LaunchAgents from pinning a versioned HomebrewCellarpath that stops resolving after the nextbrew upgrade.Why This Change Was Made
This is a branch-native backport of the Homebrew ownership and stable-service-path repair from #141011 /
8db38db91191fd5ff3db2b6398df5299b82d9fb1, originally authored by @maxsxu.The updater now recognizes only verified
openclaw-cliformula layouts and prints the owningbrew upgrade openclaw-cliworkflow. Service argument generation maps the exact formula package root to Homebrew’s stableopt/openclaw-clipath. npm, pnpm, Bun, source, Windows, unrelated Cellar paths, and npm installs located under a Homebrew prefix keep their existing behavior.Unlike the newer upstream branch, this release branch does not trust ambient
HOMEBREW_PREFIX; custom prefixes are accepted only when the trustedbrewexecutable reports an exact matchingbrew --prefix. The older release-branch updater error contract is preserved rather than importing newer updater outcome types.User Impact
Homebrew users get actionable update instructions, and refreshed Gateway/node service definitions survive formula version changes. Existing services that already contain a versioned Cellar path can be repaired after upgrading with
openclaw gateway install --force.No config, environment, SQLite, dependency, package, protocol, or migration surface changes.
Evidence
Pre-fix regressions failed for the intended reasons:
src/cli/update-cli/shared.command-runner.test.ts: formula install received the generic package-manager refusal instead of Homebrew guidance.src/daemon/program-args.test.ts: Gateway and node service arguments retained versioned Cellar paths instead of the stable opt path.Post-fix proof:
node scripts/run-vitest.mjs src/cli/update-cli/shared.command-runner.test.ts— 15/15 passed.node scripts/run-vitest.mjs src/daemon/program-args.test.ts— 36/36 passed.node scripts/run-vitest.mjs src/infra/brew.test.ts— 7/7 passed.node scripts/run-vitest.mjs src/daemon/runtime-paths.test.ts— 59/59 passed.pnpm tsgo:coreandpnpm tsgo:core:test— passed.pnpm check:coercion-helpers,pnpm check:import-cycles,pnpm docs:check-mdx,pnpm docs:check-links, andgit diff --check— passed.pnpm build— passed, including declarations and runtime postbuild.Built-flow proof used an isolated custom-prefix formula fixture with a versioned Cellar package and an
optsymlink:openclaw update --yes --no-restartexited without mutating the formula and printedbrew upgrade openclaw-cliplus the Gateway restart command.opt/openclaw-cli/.../dist/index.jsentrypoint rather than the versioned Cellar path.check:changedpassed its release-base conflict-marker, ratchet, changelog, dependency, duplicate-coverage, and formatting phases. Its later plugin-boundary report is independently red on this frozen release base because six untouched compatibility records are calendar-due on 2026-09-21; all changed-surface type, lint, import-cycle, docs, test, and build owners were run directly above.Closeout: production
+39/-1, tests+91/-1, docs+16/-0. The positive production delta establishes two required owner boundaries that the release branch lacks: exact formula ownership verification and the shared stable service entrypoint mapping. The existing stable Node helper is Node-formula-specific and cannot represent the OpenClaw package root; reusing it would conflate unrelated ownership contracts.