fix(auto-update): align PACKAGE_NAME with published package name (#3129)

Changed PACKAGE_NAME from 'oh-my-openagent' to 'oh-my-opencode' in
auto-update-checker/constants.ts to match package.json. This fixes
getCachedVersion() returning null, causing 'unknown' in version toast.

TDD: red-green confirmed. 39 tests pass, tsc clean.

Closes #3129
This commit is contained in:
YeonGyu-Kim
2026-04-07 15:10:41 +09:00
parent 3e8fd5ff18
commit eb8d7191ff
3 changed files with 17 additions and 3 deletions
@@ -1,5 +1,7 @@
import { describe, expect, it } from "bun:test"
import { readFileSync } from "node:fs"
import { join } from "node:path"
import { fileURLToPath } from "node:url"
import { getOpenCodeCacheDir } from "../../shared/data-path"
describe("auto-update-checker constants", () => {
@@ -11,4 +13,17 @@ describe("auto-update-checker constants", () => {
join(getOpenCodeCacheDir(), "packages", "node_modules", PACKAGE_NAME, "package.json")
)
})
it("PACKAGE_NAME matches the published package.json name", async () => {
// given the canonical package.json shipped with the plugin
const here = fileURLToPath(import.meta.url)
const repoPackageJsonPath = join(here, "..", "..", "..", "..", "package.json")
const repoPackageJson = JSON.parse(readFileSync(repoPackageJsonPath, "utf-8")) as { name: string }
// when the auto-update-checker constants are loaded
const { PACKAGE_NAME } = await import(`./constants?test=${Date.now()}`)
// then PACKAGE_NAME equals the actually published package name
expect(PACKAGE_NAME).toBe(repoPackageJson.name)
})
})