Skip to content

Commit bcff3a0

Browse files
authored
fix(qa): bind Codex auth fixture to runtime version (#116859)
* fix(qa): update Codex auth fixture protocol version * test(qa): bind Codex auth fixture to runtime version * test(qa): load Codex fixture version through public surface
1 parent 0892684 commit bcff3a0

3 files changed

Lines changed: 22 additions & 5 deletions

File tree

‎extensions/codex/test-api.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import {
2121
buildTurnStartParams,
2222
} from "./src/app-server/thread-lifecycle.js";
2323

24+
export { CODEX_APP_SERVER_VERSION } from "./src/app-server/version.js";
25+
2426
type CodexHarnessPromptSnapshot = {
2527
developerInstructions: string;
2628
threadStartParams: ReturnType<typeof buildThreadStartParams>;

‎test/e2e/qa-lab/runtime/codex-auth-app-server.fixture.mjs‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ const requestLog = process.env.OPENCLAW_QA_CODEX_AUTH_APP_SERVER_LOG;
99
if (!requestLog) {
1010
throw new Error("missing OPENCLAW_QA_CODEX_AUTH_APP_SERVER_LOG");
1111
}
12+
const appServerVersion = process.env.OPENCLAW_QA_CODEX_APP_SERVER_VERSION;
13+
if (!appServerVersion) {
14+
throw new Error("missing OPENCLAW_QA_CODEX_APP_SERVER_VERSION");
15+
}
1216

1317
runFakeCodexAppServer({
1418
requestLog,
@@ -18,8 +22,8 @@ runFakeCodexAppServer({
1822
sendResult(
1923
createFakeInitializeResponse({
2024
name: "openclaw-qa-codex-auth",
21-
version: "0.143.0",
22-
userAgent: "openclaw/0.143.0 (test)",
25+
version: appServerVersion,
26+
userAgent: `openclaw/${appServerVersion} (test)`,
2327
}),
2428
),
2529
"account/login/start": ({ params, sendResult }) => sendResult({ type: params?.type }),
@@ -54,7 +58,7 @@ runFakeCodexAppServer({
5458
params,
5559
threadId: "thread-qa-codex-auth",
5660
sessionId: "session-qa-codex-auth",
57-
version: "0.143.0",
61+
version: appServerVersion,
5862
}),
5963
),
6064
"turn/start": ({ notify, params, sendResult }) => {

‎test/e2e/qa-lab/runtime/codex-auth-product-proof.e2e.test.ts‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { fileURLToPath } from "node:url";
33
import { afterEach, describe, expect, it, vi } from "vitest";
44
import { createJsonlRequestTailer } from "../../../../scripts/e2e/lib/codex-media-path/jsonl-request-tail.mjs";
55
import { closeOpenClawAgentDatabasesForTest } from "../../../../src/state/openclaw-agent-db.js";
6+
import { loadBundledPluginPublicSurface } from "../../../../src/test-utils/bundled-plugin-public-surface.js";
67
import { connectGatewayStatusClient, postJson } from "../../../helpers/gateway-e2e-harness.js";
78
import {
89
createOpenClawTestInstance,
@@ -38,9 +39,15 @@ afterEach(async () => {
3839
function waitForRequest(requestLog: AppServerRequestLog, method: string) {
3940
return vi.waitFor(
4041
() => {
41-
const request = requestLog.read().find((entry) => entry.method === method);
42+
const entries = requestLog.read();
43+
const request = entries.find((entry) => entry.method === method);
4244
if (!request) {
43-
throw new Error(`waiting for Codex app-server method ${method}`);
45+
const observedMethods = entries.flatMap((entry) =>
46+
typeof entry.method === "string" ? [entry.method] : [],
47+
);
48+
throw new Error(
49+
`waiting for Codex app-server method ${method}; observed ${observedMethods.join(", ") || "no methods"}`,
50+
);
4451
}
4552
return request;
4653
},
@@ -103,13 +110,17 @@ describe("Codex auth product proof", () => {
103110
"repairs mixed legacy auth into SQLite and sends the selected OAuth profile to app-server",
104111
{ timeout: 180_000 },
105112
async () => {
113+
const { CODEX_APP_SERVER_VERSION } = await loadBundledPluginPublicSurface<{
114+
CODEX_APP_SERVER_VERSION: string;
115+
}>({ pluginId: "codex", artifactBasename: "test-api.js" });
106116
const appServerFixture = fileURLToPath(
107117
new URL("./codex-auth-app-server.fixture.mjs", import.meta.url),
108118
);
109119
instance = await createOpenClawTestInstance({
110120
name: "qa-codex-auth-product-proof",
111121
env: {
112122
OPENCLAW_AGENT_HARNESS_FALLBACK: "none",
123+
OPENCLAW_QA_CODEX_APP_SERVER_VERSION: CODEX_APP_SERVER_VERSION,
113124
OPENCLAW_SKIP_PROVIDERS: undefined,
114125
},
115126
config: {

0 commit comments

Comments
 (0)