Skip to content

Don't reinstall a stale OpenClaw package over a working CLI - #11969

Open
Chessing234 wants to merge 1 commit into
omacom:quattrofrom
Chessing234:fix/11829-openclaw-install-gate
Open

Chessing234 wants to merge 1 commit into
omacom:quattrofrom
Chessing234:fix/11829-openclaw-install-gate

Conversation

@Chessing234

@Chessing234 Chessing234 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Install > AI > OpenClaw only looked for the pacman package, so after pacman -R openclaw it re-offered a possibly older package that shadows a newer CLI on PATH and breaks a migrated state DB.
  • Treat OpenClaw as present when the package, a PATH openclaw, or the gateway unit exists.
  • Skip package install in that case, and warn when multiple openclaw binaries are on PATH.

Fixes #11829

Test plan

  • bash test/shell.d/openclaw-present-test.sh
  • With only an npm openclaw on PATH, Install > AI hides OpenClaw
  • omarchy-install-openclaw-cli --now does not run pacman -S openclaw when PATH already has it
  • Launching with two openclaw binaries prints a PATH warning

The Install > AI entry keyed only on the openclaw package, so removing it
re-offered a possibly older package that shadows a newer CLI on PATH and
breaks a migrated state database. Gate install on package, PATH, or
gateway, skip package reinstall when one of those is already present, and
warn when multiple openclaw binaries are on PATH.
@smfworks

Copy link
Copy Markdown
Contributor

Verified this against a machine living in exactly the scenario the PR targets (multi-binary OpenClaw install, package + PATH + gateway all present):

  • omarchy-openclaw-present → exit 0, correct via all three branches: the openclaw 2026.9.4-1 pacman package is installed, command -v openclaw finds a CLI, and openclaw-gateway.service is enabled. /usr/bin/openclaw is the package's wrapper (exec node /usr/lib/node_modules/openclaw/openclaw.mjs "$@") coexisting with npm/mise installs — the stale-shadow scenario this PR exists for.
  • omarchy-install-openclaw-cli --check → 0; --now → 0 with no pacman -S run. Correct skip behavior.
  • The launcher's multi-binary detection fires on this machine with the real list: agent-cli wrapper, mise install, /usr/bin, /bin, mise shim — warning names the one bare openclaw resolves to. Exactly right.
  • test/shell.d/default-agent-test.sh fully green (47 ok) — and removing the old openclaw mock is the correct call, since it would otherwise masquerade as a present install under the new presence logic.

One bug found: the new openclaw-present-test.sh is not host-hermetic. The fixture sets PATH="$tmp/bin:$ROOT/bin:/usr/bin:/bin", so on any machine with a real openclaw in /usr/bin — precisely the population this PR cares about — command -v openclaw finds the host binary and the first assertion fails:

not ok - absent OpenClaw should not count as present

The "absent" fixture (mocked omarchy-pkg-present → 1, mocked systemctl → 1, no unit file) is correct, but the host's binary leaks into the PATH check. Suggested fix: build the absent fixture from a controlled core-tools dir (symlinks to just the binaries the script and base-test.sh need) instead of the host /usr/bin:/bin, or otherwise mask any host openclaw for that scenario. Happy to verify a fix against this machine — it's a perfect reproduction host.

Interop note: the presence ladder also treats a mise/npm-installed CLI or gateway unit as present, so this composes cleanly with the npm-based install flow proposed in #7919 if that lands later.

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.

OpenClaw: stale omarchy-repo package shadows newer OpenClaw on PATH and breaks migrated state; Install menu re-offers it

2 participants