fix(coding-agent): harden omp update install-target detection

Use Bun-native command execution and PATH-prioritized resolution so updates apply to the installation users actually invoke.\n\nFixes #247
This commit is contained in:
can1357
2026-03-03 05:29:26 +01:00
parent 10ee8fa107
commit b0fef96800
3 changed files with 154 additions and 67 deletions
@@ -0,0 +1,22 @@
import { describe, expect, it } from "bun:test";
import { _resolveUpdateMethodForTest } from "../src/cli/update-cli";
describe("update-cli install target detection", () => {
it("uses bun update when prioritized omp is inside bun global bin", () => {
const method = _resolveUpdateMethodForTest("/Users/test/.bun/bin/omp", "/Users/test/.bun/bin");
expect(method).toBe("bun");
});
it("uses binary update when prioritized omp is outside bun global bin", () => {
const method = _resolveUpdateMethodForTest("/Users/test/.local/bin/omp", "/Users/test/.bun/bin");
expect(method).toBe("binary");
});
it("uses binary update when bun global bin cannot be resolved", () => {
const method = _resolveUpdateMethodForTest("/Users/test/.local/bin/omp", undefined);
expect(method).toBe("binary");
});
});