Skip to content

Commit 841f25e

Browse files
authored
fix(codex): accept newer desktop app-server versions (#126450)
1 parent beb466d commit 841f25e

8 files changed

Lines changed: 34 additions & 73 deletions

File tree

‎docs/plugins/codex-harness-reference.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,11 @@ If the normal app-server runtime would be `danger-full-access`, enabling
317317
permission profile instead. Codex-managed network enforcement is sandboxed
318318
networking, so a full-access profile would not protect outbound traffic.
319319

320-
The plugin ships Codex app-server `0.147.0` and accepts external versions through
321-
`0.148.0-alpha.15`. Versions outside that tested range and malformed or
322-
unversioned handshakes are rejected. Build metadata does not affect SemVer
323-
precedence. The same range applies to explicit custom executables, remote
324-
app-servers, and macOS desktop binaries; admission is not readiness proof.
320+
The plugin ships Codex app-server `0.147.0` and accepts external versions at or
321+
above that minimum. Older, malformed, and unversioned handshakes are rejected.
322+
Build metadata does not affect SemVer precedence. The same minimum applies to
323+
explicit custom executables, remote app-servers, and macOS desktop binaries;
324+
admission is not readiness proof.
325325

326326
OpenClaw treats non-loopback WebSocket app-server URLs as remote and requires
327327
identity-bearing WebSocket auth through `appServer.authToken` or an

‎docs/plugins/codex-harness.md‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ channel is the communication surface.
8989

9090
- The official `@openclaw/codex` plugin installed. Include `codex` in
9191
`plugins.allow` if your config uses an allowlist.
92-
- Codex app-server `0.147.0` through `0.148.0-alpha.15`. The plugin still ships and manages the
92+
- Codex app-server `0.147.0` or newer. The plugin still ships and manages the
9393
exact `@openai/codex` `0.147.0` artifact, so a `codex` command on `PATH` does
9494
not affect normal startup. Explicit custom, remote, and macOS desktop-owned
95-
app-servers must report valid SemVer inside that tested external range.
96-
Versions above the managed artifact initialize with a warning; acceptance
97-
permits an attempt and is not readiness or capability proof.
95+
app-servers must report valid SemVer at or above that managed baseline.
96+
Newer versions initialize with a warning; acceptance permits an attempt and
97+
is not readiness or capability proof.
9898
- Node.js on the remote Codex app-server host when `remoteWorkspaceRoot` is set
9999
and cross-machine workspace attachments must be transferred.
100100
- Codex auth through `openclaw models auth login --provider openai`, an
@@ -1355,11 +1355,10 @@ instead of a plain OpenAI API-key failure.
13551355
Doctor rewrites legacy model refs to `openai/*`, removes stale session and
13561356
whole-agent runtime pins, and preserves existing auth-profile overrides.
13571357

1358-
**The app-server is rejected:** use Codex `0.147.0` through
1359-
`0.148.0-alpha.15`. OpenClaw rejects versions outside that tested range, plus
1360-
malformed and unversioned servers. Same-version prereleases such as
1358+
**The app-server is rejected:** use Codex `0.147.0` or newer. OpenClaw rejects
1359+
older, malformed, and unversioned servers. Same-version prereleases such as
13611360
`0.147.0-alpha.2` remain below the stable minimum; build metadata such as
1362-
`0.147.0+desktop` does not affect precedence. An accepted external version is
1361+
`0.147.0+desktop` does not affect precedence. A newer external version is
13631362
permitted to initialize rather than treated as proof of compatibility, so
13641363
startup and capability operations can still fail with their normal diagnostics.
13651364

‎docs/plugins/codex-native-plugins.md‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ working.
2222
- The agent runtime must be the native Codex harness.
2323
- `plugins.entries.codex.enabled` is `true`.
2424
- `plugins.entries.codex.config.codexPlugins.enabled` is `true`.
25-
- Codex app-server reports a version from `0.147.0` through
26-
`0.148.0-alpha.15`. The official plugin still ships `@openai/codex`
27-
`0.147.0`; accepted external versions remain subject to normal startup and
28-
capability validation.
25+
- Codex app-server reports version `0.147.0` or newer. The official plugin
26+
still ships `@openai/codex` `0.147.0`; accepted external versions remain
27+
subject to normal startup and capability validation.
2928
- The target Codex app-server can see the expected marketplace, plugin, and
3029
app inventory.
3130
- Migration supports only `openai-curated` plugins that it observed as

‎docs/plugins/sdk-agent-harness.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,8 @@ For operator setup, model prefix examples, and Codex-only configs, see
319319

320320
The Codex plugin enforces the minimum app-server version documented in
321321
[Codex Harness](/plugins/codex-harness). It checks the initialize handshake and
322-
blocks versions outside the tested external range plus malformed or unversioned
323-
servers. Admission permits startup to continue; it does not prove later runtime
324-
or capability operations will succeed.
322+
blocks older, malformed, or unversioned servers. Admission permits startup to
323+
continue; it does not prove later runtime or capability operations will succeed.
325324

326325
### Tool-result middleware
327326

‎extensions/codex/src/app-server/client.test.ts‎

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@ import {
88
} from "./client.js";
99
import { resetSharedCodexAppServerClientForTests } from "./shared-client.js";
1010
import { createClientHarness } from "./test-support.js";
11-
import {
12-
CODEX_APP_SERVER_VERSION,
13-
MAX_SUPPORTED_CODEX_APP_SERVER_VERSION,
14-
MIN_SUPPORTED_CODEX_APP_SERVER_VERSION,
15-
} from "./version.js";
11+
import { CODEX_APP_SERVER_VERSION, MIN_SUPPORTED_CODEX_APP_SERVER_VERSION } from "./version.js";
1612

1713
const CODEX_DYNAMIC_TOOL_SERVER_REQUEST_TIMEOUT_MS = 660_000;
1814

@@ -369,7 +365,7 @@ describe("CodexAppServerClient", () => {
369365
});
370366

371367
await expect(initializing).rejects.toThrow(
372-
`A Codex app-server from ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} through ${MAX_SUPPORTED_CODEX_APP_SERVER_VERSION} is required, but detected 0.146.9`,
368+
`Codex app-server ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} or newer is required, but detected 0.146.9`,
373369
);
374370
expect(harness.writes).toHaveLength(1);
375371
});
@@ -382,7 +378,7 @@ describe("CodexAppServerClient", () => {
382378
});
383379

384380
await expect(initializing).rejects.toThrow(
385-
`A Codex app-server from ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} through ${MAX_SUPPORTED_CODEX_APP_SERVER_VERSION} is required, but detected 0.146.0`,
381+
`Codex app-server ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} or newer is required, but detected 0.146.0`,
386382
);
387383
expect(harness.writes).toHaveLength(1);
388384
});
@@ -395,7 +391,7 @@ describe("CodexAppServerClient", () => {
395391
});
396392

397393
await expect(initializing).rejects.toThrow(
398-
`A Codex app-server from ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} through ${MAX_SUPPORTED_CODEX_APP_SERVER_VERSION} is required, but detected 0.147.0-alpha.2`,
394+
`Codex app-server ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} or newer is required, but detected 0.147.0-alpha.2`,
399395
);
400396
expect(harness.writes).toHaveLength(1);
401397
});
@@ -422,7 +418,7 @@ describe("CodexAppServerClient", () => {
422418
});
423419

424420
await expect(initializing).rejects.toThrow(
425-
`A Codex app-server from ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} through ${MAX_SUPPORTED_CODEX_APP_SERVER_VERSION} is required`,
421+
`Codex app-server ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} or newer is required`,
426422
);
427423
expect(harness.writes).toHaveLength(1);
428424
});
@@ -435,13 +431,13 @@ describe("CodexAppServerClient", () => {
435431
});
436432

437433
await expect(initializing).rejects.toThrow(
438-
`A Codex app-server from ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} through ${MAX_SUPPORTED_CODEX_APP_SERVER_VERSION} is required`,
434+
`Codex app-server ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} or newer is required`,
439435
);
440436
expect(harness.writes).toHaveLength(1);
441437
});
442438

443-
it.each(["0.148.0-alpha.9", MAX_SUPPORTED_CODEX_APP_SERVER_VERSION])(
444-
"accepts tested Codex Desktop prerelease %s for normal startup validation",
439+
it.each(["0.148.0-alpha.9", "0.148.0-alpha.15", "0.148.0-alpha.23", "0.148.0", "1.0.0"])(
440+
"accepts a newer app-server version %s for normal startup validation",
445441
async (newerVersion) => {
446442
const warn = vi.spyOn(embeddedAgentLog, "warn").mockImplementation(() => undefined);
447443
const { harness, initializing, outbound } = startInitialize();
@@ -463,22 +459,6 @@ describe("CodexAppServerClient", () => {
463459
},
464460
);
465461

466-
it.each(["0.148.0-alpha.16", "0.148.0", "1.0.0"])(
467-
"blocks unverified future app-server version %s during initialize",
468-
async (version) => {
469-
const { harness, initializing, outbound } = startInitialize();
470-
harness.send({
471-
id: outbound.id,
472-
result: { userAgent: `openclaw/${version} (macOS; test)` },
473-
});
474-
475-
await expect(initializing).rejects.toThrow(
476-
`through ${MAX_SUPPORTED_CODEX_APP_SERVER_VERSION} is required`,
477-
);
478-
expect(harness.writes).toHaveLength(1);
479-
},
480-
);
481-
482462
it.each(["0.147.00", "0.148.0-alpha..9", "0.148.0-alpha.09"])(
483463
"blocks malformed app-server version %s during initialize",
484464
async (version) => {
@@ -489,7 +469,7 @@ describe("CodexAppServerClient", () => {
489469
});
490470

491471
await expect(initializing).rejects.toThrow(
492-
`A Codex app-server from ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} through ${MAX_SUPPORTED_CODEX_APP_SERVER_VERSION} is required`,
472+
`Codex app-server ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} or newer is required`,
493473
);
494474
expect(harness.writes).toHaveLength(1);
495475
},
@@ -500,7 +480,7 @@ describe("CodexAppServerClient", () => {
500480
harness.send({ id: outbound.id, result: {} });
501481

502482
await expect(initializing).rejects.toThrow(
503-
`A Codex app-server from ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} through ${MAX_SUPPORTED_CODEX_APP_SERVER_VERSION} is required`,
483+
`Codex app-server ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} or newer is required`,
504484
);
505485
expect(harness.writes).toHaveLength(1);
506486
});

‎extensions/codex/src/app-server/client.ts‎

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,7 @@ import {
3232
closeCodexAppServerTransportAndWait,
3333
type CodexAppServerTransport,
3434
} from "./transport.js";
35-
import {
36-
CODEX_APP_SERVER_VERSION,
37-
MAX_SUPPORTED_CODEX_APP_SERVER_VERSION,
38-
MIN_SUPPORTED_CODEX_APP_SERVER_VERSION,
39-
} from "./version.js";
35+
import { CODEX_APP_SERVER_VERSION, MIN_SUPPORTED_CODEX_APP_SERVER_VERSION } from "./version.js";
4036

4137
const CODEX_APP_SERVER_PARSE_LOG_MAX = 500;
4238
const CODEX_APP_SERVER_PARSE_BUFFER_MAX = 8 * 1024 * 1024;
@@ -1009,7 +1005,7 @@ class CodexAppServerVersionError extends Error {
10091005
? `detected ${detectedVersion}`
10101006
: "OpenClaw could not determine the running Codex version";
10111007
super(
1012-
`A Codex app-server from ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} through ${MAX_SUPPORTED_CODEX_APP_SERVER_VERSION} is required, but ${detected}. Update the configured Codex app-server binary, or remove custom command overrides to use the managed binary.`,
1008+
`Codex app-server ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} or newer is required, but ${detected}. Update the configured Codex app-server binary, or remove custom command overrides to use the managed binary.`,
10131009
);
10141010
this.name = "CodexAppServerVersionError";
10151011
this.detectedVersion = detectedVersion;
@@ -1022,11 +1018,7 @@ function assertSupportedCodexAppServerVersion(response: CodexInitializeResponse)
10221018
throw new CodexAppServerVersionError(detectedVersion);
10231019
}
10241020
const detected = parseSemver(detectedVersion);
1025-
if (
1026-
!detected ||
1027-
detected.compare(MIN_SUPPORTED_CODEX_APP_SERVER_VERSION) < 0 ||
1028-
detected.compare(MAX_SUPPORTED_CODEX_APP_SERVER_VERSION) > 0
1029-
) {
1021+
if (!detected || detected.compare(MIN_SUPPORTED_CODEX_APP_SERVER_VERSION) < 0) {
10301022
throw new CodexAppServerVersionError(detectedVersion);
10311023
}
10321024
if (detected.compare(CODEX_APP_SERVER_VERSION) > 0) {

‎extensions/codex/src/app-server/shared-client.test.ts‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ import type { CodexAppServerStartOptions } from "./config.js";
99
import { acquireCodexNativeConfigFence } from "./native-config-fence.js";
1010
import { codexNativeSubagentMonitorRuntime } from "./native-subagent-monitor.js";
1111
import { createClientHarness } from "./test-support.js";
12-
import {
13-
CODEX_APP_SERVER_VERSION,
14-
MAX_SUPPORTED_CODEX_APP_SERVER_VERSION,
15-
MIN_SUPPORTED_CODEX_APP_SERVER_VERSION,
16-
} from "./version.js";
12+
import { CODEX_APP_SERVER_VERSION, MIN_SUPPORTED_CODEX_APP_SERVER_VERSION } from "./version.js";
1713

1814
const mocks = vi.hoisted(() => ({
1915
bridgeCodexAppServerStartOptions: vi.fn(async ({ startOptions }) => startOptions),
@@ -283,7 +279,7 @@ describe("shared Codex app-server client", () => {
283279
await sendInitializeResult(harness, "openclaw/0.117.9 (macOS; test)");
284280

285281
await expect(listPromise).rejects.toThrow(
286-
`A Codex app-server from ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} through ${MAX_SUPPORTED_CODEX_APP_SERVER_VERSION} is required`,
282+
`Codex app-server ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} or newer is required`,
287283
);
288284
expect(harness.process.stdin.destroyed).toBe(true);
289285
startSpy.mockRestore();
@@ -518,7 +514,7 @@ describe("shared Codex app-server client", () => {
518514
const startOptions = configureManagedDesktopFallback();
519515

520516
const acquire = getSharedCodexAppServerClient({ startOptions, timeoutMs: 1_000 });
521-
await sendInitializeResult(desktop, "openclaw/0.148.0-alpha.9 (macOS; test)");
517+
await sendInitializeResult(desktop, "openclaw/0.148.0-alpha.23 (macOS; test)");
522518
const client = await acquire;
523519

524520
expect(client).toBe(desktop.client);
@@ -532,7 +528,7 @@ describe("shared Codex app-server client", () => {
532528
expect(mocks.embeddedAgentLog.warn).toHaveBeenCalledWith(
533529
"codex app-server is newer than OpenClaw's managed runtime; continuing with normal startup validation",
534530
{
535-
detectedVersion: "0.148.0-alpha.9",
531+
detectedVersion: "0.148.0-alpha.23",
536532
validatedVersion: CODEX_APP_SERVER_VERSION,
537533
},
538534
);

‎extensions/codex/src/app-server/version.ts‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,5 @@
55
export const CODEX_APP_SERVER_VERSION = "0.147.0";
66
/** Inclusive runtime compatibility floor for external app-server binaries. */
77
export const MIN_SUPPORTED_CODEX_APP_SERVER_VERSION = "0.147.0";
8-
/** Inclusive runtime compatibility ceiling for external app-server binaries. */
9-
// The ceiling is the newest Desktop build covered by upstream source inspection and
10-
// a live Computer Use flow. Raising it requires equivalent protocol and live proof.
11-
export const MAX_SUPPORTED_CODEX_APP_SERVER_VERSION = "0.148.0-alpha.15";
128
/** npm package name for the managed Codex app-server binary. */
139
export const MANAGED_CODEX_APP_SERVER_PACKAGE = "@openai/codex";

0 commit comments

Comments
 (0)