fix(ci): authenticate live Codex Docker release probe (#108400)

* test(codex): route live Docker probe through OpenAI auth

* test(docker): assert bounded Codex error handling
This commit is contained in:
Peter Steinberger
2026-07-15 10:32:15 -07:00
committed by GitHub
parent 1d2777548d
commit a99b5a686b
4 changed files with 54 additions and 15 deletions
+42 -3
View File
@@ -1,7 +1,7 @@
// Codex Install Assertions tests cover Codex plugin install E2E helpers.
import { spawnSync } from "node:child_process";
import { createHash } from "node:crypto";
import { chmodSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
import { chmodSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
import os from "node:os";
import path from "node:path";
import { DatabaseSync } from "node:sqlite";
@@ -121,6 +121,19 @@ function runCodexNpmPluginLiveAssertions(params: {
);
}
function runCodexNpmPluginLiveConfigure(root: string) {
return spawnSync(process.execPath, [CODEX_NPM_PLUGIN_LIVE_ASSERTIONS_SCRIPT, "configure"], {
encoding: "utf8",
env: {
...process.env,
HOME: path.join(root, "home"),
NODE_OPTIONS: nodeOptionsWithoutExperimentalWarnings(),
OPENCLAW_CONFIG_PATH: path.join(root, "state", "openclaw.json"),
OPENCLAW_STATE_DIR: path.join(root, "state"),
},
});
}
function writeCodexBindingStateSqlite(params: {
stateDir: string;
sessionKey: string;
@@ -237,10 +250,10 @@ function createCodexNpmPluginLiveFixture(root: string, storedSessionId?: string)
const sessionId = "codex-npm-plugin-live";
const marker = "OPENCLAW-CODEX-NPM-PLUGIN-LIVE-OK";
const threadId = "thread-codex-npm-live";
const modelRef = "codex/gpt-5.4";
const modelRef = "openai/gpt-5.4";
writeJson("/tmp/openclaw-codex-agent.json", {
payloads: [{ text: marker }],
meta: { executionTrace: { winnerProvider: "codex" } },
meta: { executionTrace: { winnerProvider: "openai" } },
});
writeSessionStoreSqlite({
stateDir,
@@ -323,6 +336,32 @@ function createCodexInstallFixture(root: string) {
}
describe("Codex install helpers", () => {
it("configures the canonical OpenAI model for the Codex runtime by default", () => {
const root = makeTempDir(tempDirs, "openclaw-codex-npm-configure-");
const result = runCodexNpmPluginLiveConfigure(root);
expect(result.status).toBe(0);
expect(result.stderr).toBe("");
const config = JSON.parse(readFileSync(path.join(root, "state", "openclaw.json"), "utf8")) as {
agents: {
defaults: {
model: { primary: string; fallbacks: string[] };
models: Record<string, { agentRuntime: { id: string } }>;
};
};
};
expect(config.agents.defaults.model).toEqual({
primary: "openai/gpt-5.4",
fallbacks: [],
});
expect(config.agents.defaults.models).toMatchObject({
"openai/gpt-5.4": { agentRuntime: { id: "codex" } },
});
expect(config.agents.defaults.models).not.toHaveProperty("codex/gpt-5.4");
});
it("resolves package roots and package manifests inside managed npm installs", () => {
const root = makeTempDir(tempDirs, "openclaw-codex-install-utils-");
const packageRoot = path.join(