fix(cli): make `omo update` actually report its refusal honestly (Fixes #7172)

AC
19d ago
+264-17

What changed

packages/omo-native/bin/lib/launcher.js (runLauncher, self-update branch): every self-update spelling of omo update (update, update --self|self|senpi|omo) is now answered with

omo does not self-update (the senpi engine is version-pinned).
Run: <updateTarget().command>

and process.exitCode = 1, instead of the previous omo is updated via <manager>: <command> + exit 0.

packages/omo-native/test/launcher.test.ts: new regression block asserting, for every spelling and for both npm- and Bun-managed layouts, that the launcher exits 1, prints the refusal plus the runnable command, and never spawns senpi. Existing assertions that pinned the old contract were re-pointed to the corrected one; no test was deleted or weakened.

Why

The launcher refuses self-update by design - @code-yeongyu/senpi is exact-pinned, so a self-update would break the pairing - but it reported that refusal with past-tense success wording and exit code 0. omo update && echo ok printed ok, so wrapper scripts and CI steps recorded an update that never happened (#7172). The wording is now an explicit instruction to run the printed command, and the non-zero exit makes "not updated" machine-detectable.

How verified

Evidence: .omo/evidence/20260824-omo-update-noop/ (plan.md, qa.log, evidence.md).

  • Failing-first: with the fix reverted and the new tests in place, all 6 new regression tests fail (exit 0 + old wording observed).
  • After the fix: bun test packages/omo-native/test/launcher.test.ts → 43 pass / 0 fail. The suite spawns the real bin/omo.js via spawnSync against a fake senpi tree across bun-global / bun-legacy / npm / unknown install layouts; a capture file proves senpi never spawns on this path.
  • Real-binary drive: HOME=<isolated tmp> node packages/omo-native/bin/omo.js update → exit 1, exact refusal output above, stderr empty, isolated HOME untouched.
  • bunx tsc -p packages/omo-native/tsconfig.json --noEmit → clean.
  • Entry smoke: node packages/omo-native/bin/omo.js --version → omo 5.0.0-0.beta.18 (engine: senpi 2026.8.23).

Residual risk

  • The local-install launcher generator packages/omo-senpi/src/install/local-launcher.ts (and its bundled artifact plugin/scripts/install.mjs) prints the same misleading line with exit 0 for local installs. Fixing it belongs to the senpi adapter's own QA gate; deliberately left out of this minimal fix and best handled as a follow-up.
  • Scripts that treated exit 0 as "updated" will now see exit 1. That is the requested contract change (#7172), but any internal automation relying on the old behavior needs the same one-line adjustment.
  • payload.test.ts fails in my environment identically on a clean checkout (needs the build:omo-native staged payload whose submodule fetch is blocked here); pre-existing and unrelated.

Fixes #7172


Summary by cubic

Refuses all self-update requests in the CLI with a clear message and exit code 1. Previously, omo update printed a past-tense success line and exited 0 without updating, which misled wrappers and CI (Fixes #7172).

  • Old behavior: printed “omo is updated via : ” and exited 0 while doing nothing.
  • New behavior: prints “omo does not self-update (the senpi engine is version-pinned).” followed by “Run: ” and exits 1. Covers update, update --self, update self, update senpi, and update omo. The engine path is unchanged and never spawns.
  • Tests: added regression cases asserting non-zero exit, exact guidance, manager-specific command (npm/Bun), and no senpi spawn; updated existing assertions to the new contract. Evidence captured under .omo/evidence/....
  • Review focus: only the self-update branch in packages/omo-native/bin/lib/launcher.js changed; engine-spawn paths are not touched. Tests live in packages/omo-native/test/launcher.test.ts.
  • Migration action: update any scripts that relied on omo update exiting 0 to treat exit 1 as “not updated” and run the printed command. Note: the local-install launcher in packages/omo-senpi still prints the old message and exit 0; follow-up tracked separately.