Files
openclaw/extensions/codex/src/manifest.test.ts
Vitor Cepeda Lopes e00f860198 fix(codex): Computer Use fails when Desktop bundles a newer app-server (#125883)
* fix(codex): allow newer app-server runtimes

* fix(codex): bound external app-server compatibility

---------

Co-authored-by: TheAngryPit <16145902+TheAngryPit@users.noreply.github.com>
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
2026-08-19 14:42:33 -07:00

57 lines
2.0 KiB
TypeScript

// Codex tests cover manifest plugin behavior.
import fs from "node:fs";
import { describe, expect, it } from "vitest";
import { CODEX_APP_SERVER_VERSION } from "./app-server/version.js";
type CodexPackageManifest = {
dependencies?: Record<string, string>;
devDependencies?: Record<string, string>;
openclaw?: {
install?: {
requiredPlatformPackages?: string[];
};
release?: {
requireLatestDependencies?: string[];
};
};
};
describe("codex package manifest", () => {
it("keeps runtime dependencies in the package manifest", () => {
const packageJson = JSON.parse(
fs.readFileSync(new URL("../package.json", import.meta.url), "utf8"),
) as CodexPackageManifest;
expect(packageJson.devDependencies).toHaveProperty("@openclaw/plugin-sdk");
expect(packageJson.dependencies?.["@openai/codex"]).toBe(CODEX_APP_SERVER_VERSION);
expect(packageJson.openclaw?.release?.requireLatestDependencies).toEqual(["@openai/codex"]);
expect(packageJson.openclaw?.install?.requiredPlatformPackages).toEqual([
"@openai/codex-linux-x64",
"@openai/codex-linux-arm64",
"@openai/codex-darwin-x64",
"@openai/codex-darwin-arm64",
"@openai/codex-win32-x64",
"@openai/codex-win32-arm64",
]);
});
it("keeps managed Codex and the ACP adapter on the same exact bundled version", () => {
const workspace = fs.readFileSync(
new URL("../../../pnpm-workspace.yaml", import.meta.url),
"utf8",
);
const lockfile = fs.readFileSync(new URL("../../../pnpm-lock.yaml", import.meta.url), "utf8");
expect(workspace).toContain(
`"@agentclientprotocol/codex-acp@1.1.7>@openai/codex": ${CODEX_APP_SERVER_VERSION}`,
);
expect(lockfile).toContain(
`'@agentclientprotocol/codex-acp@1.1.7>@openai/codex': ${CODEX_APP_SERVER_VERSION}`,
);
const lockedCodexVersions = new Set(
[...lockfile.matchAll(/@openai\/codex@(\d+\.\d+\.\d+)/g)].map((match) => match[1]),
);
expect([...lockedCodexVersions]).toEqual([CODEX_APP_SERVER_VERSION]);
});
});