fix(update): fetch musl release asset on musl hosts and align musl release test

- omp update's getBinaryName now detects a musl Linux host (Alpine release file or /lib/ld-musl-* loader, mirroring scripts/install.sh) and downloads omp-linux-musl-<arch>, so self-update no longer replaces a musl install with the glibc build.
- Updated musl-release dry-run assertions to the Bun.build output format the binaries script now emits; promoted the musl changelog entry to [Unreleased].
This commit is contained in:
can1357
2026-07-22 23:12:24 +02:00
parent 6a517cfbbc
commit 59877a01bd
3 changed files with 25 additions and 5 deletions
+5 -1
View File
@@ -7,9 +7,14 @@
- Added `/tree` re-answer for a past `ask` toolResult: selecting it now re-opens the picker with the original questions and branches the new answer as a sibling toolResult, leaving the original answer's branch reachable ([#5895](https://github.com/can1357/oh-my-pi/pull/5895) by [@Mathews-Tom](https://github.com/Mathews-Tom)).
- Added configurable Hindsight client request deadlines via `hindsight.requestTimeoutMs` / `reflectTimeoutMs` / `recallTimeoutMs` / `retainTimeoutMs` settings (and matching `HINDSIGHT_*_TIMEOUT_MS` env vars).
### Changed
- Added `omp-linux-musl-x64` and `omp-linux-musl-arm64` release binaries for Alpine and other musl-based Linux distributions, with automatic musl selection in the binary installer. ([#3367](https://github.com/can1357/oh-my-pi/issues/3367))
### Fixed
- Fixed `Ctrl+V` clipboard paste being dropped while API-key and other modal prompts own focus ([#6057](https://github.com/can1357/oh-my-pi/issues/6057)).
- Fixed `omp update` on musl-based Linux hosts downloading the glibc release binary over a musl install; self-update now detects a musl host (Alpine release file or musl loader) and fetches the matching `omp-linux-musl-*` asset.
- Fixed `scripts/install.sh` installing an x86_64 build on Apple Silicon when an x86_64 `bun` runs under Rosetta. The default path only checked whether `bun` existed; it now compares `bun`'s `process.arch` to the host (detected via `sysctl -in hw.optional.arm64` so Rosetta can't spoof it) and falls back to the prebuilt native binary on a mismatch, while `--source` errors with an actionable message. `install_binary` also derives the arch from the real host instead of the Rosetta-translated `uname -m` ([#6268](https://github.com/can1357/oh-my-pi/issues/6268)).
- Fixed the model picker hiding Codex models available only through a second configured ChatGPT/Codex OAuth account. Catalog discovery now resolves every stored `openai-codex` OAuth account and unions their `/models` catalogs instead of surfacing only the discovery preflight account's list ([#6265](https://github.com/can1357/oh-my-pi/issues/6265)).
- Fixed GitHub Copilot 1M-context models (e.g. `github-copilot/gpt-5.6-sol-1m`) disappearing from the model picker on restart, with a `Could not restore model` warning, until discovery was manually refreshed. The startup cache loader now restores their transport headers from the bundled base via `requestModelId`. ([#6037](https://github.com/can1357/oh-my-pi/issues/6037), [#6284](https://github.com/can1357/oh-my-pi/issues/6284))
@@ -747,7 +752,6 @@
- Redesigned OAuth logins to run inside a cancellable dialog (aborted via Esc) rather than an inescapable pairing prompt.
- Reworked the subagent soft request budget to gracefully steer child agents to wrap up and yield partial findings instead of silently terminating them, and raised the default budget to 200 requests.
- Updated task rendering to retain the agent type badge on live progress and finished result rows.
- Added `omp-linux-musl-x64` and `omp-linux-musl-arm64` release binaries for Alpine and other musl-based Linux distributions, with automatic musl selection in the binary installer. ([#3367](https://github.com/can1357/oh-my-pi/issues/3367))
### Fixed
+14 -1
View File
@@ -556,6 +556,19 @@ async function pruneBunCacheAfterGlobalInstall(): Promise<BunInstallCachePruneRe
return await pruneBunInstallCache(cacheDir, packageNames.size === 0 ? undefined : packageNames);
}
/**
* Detect a musl-libc Linux host (Alpine, Void-musl) so self-update replaces a
* musl binary with the musl release asset instead of the glibc build, which
* would fail to start on the next run. Mirrors the detection in
* scripts/install.sh.
*/
function isMuslLinux(): boolean {
if (process.platform !== "linux") return false;
if (fs.existsSync("/etc/alpine-release")) return true;
const loaderArch = process.arch === "arm64" ? "aarch64" : "x86_64";
return fs.existsSync(`/lib/ld-musl-${loaderArch}.so.1`);
}
/**
* Get the appropriate binary name for this platform.
*/
@@ -566,7 +579,7 @@ function getBinaryName(): string {
let os: string;
switch (platform) {
case "linux":
os = "linux";
os = isMuslLinux() ? "linux-musl" : "linux";
break;
case "darwin":
os = "darwin";
+6 -3
View File
@@ -10,7 +10,10 @@ afterEach(async () => {
await Promise.all(tempDirs.splice(0).map(dir => fs.rm(dir, { recursive: true, force: true })));
});
async function run(command: string[], env: NodeJS.ProcessEnv = process.env): Promise<{ exitCode: number; stdout: string; stderr: string }> {
async function run(
command: string[],
env: NodeJS.ProcessEnv = process.env,
): Promise<{ exitCode: number; stdout: string; stderr: string }> {
const proc = Bun.spawn(command, {
cwd: repoRoot,
env,
@@ -43,10 +46,10 @@ describe("musl release artifacts", () => {
expect(result.exitCode, result.stderr).toBe(0);
expect(result.stdout).toContain(
"--target=bun-linux-x64-musl-baseline ./packages/coding-agent/src/cli.ts --outfile packages/coding-agent/binaries/omp-linux-musl-x64",
"Bun.build target=bun-linux-x64-musl-baseline outfile=packages/coding-agent/binaries/omp-linux-musl-x64",
);
expect(result.stdout).toContain(
"--target=bun-linux-arm64-musl ./packages/coding-agent/src/cli.ts --outfile packages/coding-agent/binaries/omp-linux-musl-arm64",
"Bun.build target=bun-linux-arm64-musl outfile=packages/coding-agent/binaries/omp-linux-musl-arm64",
);
});