Skip to content

Commit 124823f

Browse files
committed
fix(codex): accept newer desktop app-server versions
1 parent e00f860 commit 124823f

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

@@ -365,7 +361,7 @@ describe("CodexAppServerClient", () => {
365361
});
366362

367363
await expect(initializing).rejects.toThrow(
368-
`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`,
364+
`Codex app-server ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} or newer is required, but detected 0.146.9`,
369365
);
370366
expect(harness.writes).toHaveLength(1);
371367
});
@@ -378,7 +374,7 @@ describe("CodexAppServerClient", () => {
378374
});
379375

380376
await expect(initializing).rejects.toThrow(
381-
`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`,
377+
`Codex app-server ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} or newer is required, but detected 0.146.0`,
382378
);
383379
expect(harness.writes).toHaveLength(1);
384380
});
@@ -391,7 +387,7 @@ describe("CodexAppServerClient", () => {
391387
});
392388

393389
await expect(initializing).rejects.toThrow(
394-
`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`,
390+
`Codex app-server ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} or newer is required, but detected 0.147.0-alpha.2`,
395391
);
396392
expect(harness.writes).toHaveLength(1);
397393
});
@@ -418,7 +414,7 @@ describe("CodexAppServerClient", () => {
418414
});
419415

420416
await expect(initializing).rejects.toThrow(
421-
`A Codex app-server from ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} through ${MAX_SUPPORTED_CODEX_APP_SERVER_VERSION} is required`,
417+
`Codex app-server ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} or newer is required`,
422418
);
423419
expect(harness.writes).toHaveLength(1);
424420
});
@@ -431,13 +427,13 @@ describe("CodexAppServerClient", () => {
431427
});
432428

433429
await expect(initializing).rejects.toThrow(
434-
`A Codex app-server from ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} through ${MAX_SUPPORTED_CODEX_APP_SERVER_VERSION} is required`,
430+
`Codex app-server ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} or newer is required`,
435431
);
436432
expect(harness.writes).toHaveLength(1);
437433
});
438434

439-
it.each(["0.148.0-alpha.9", MAX_SUPPORTED_CODEX_APP_SERVER_VERSION])(
440-
"accepts tested Codex Desktop prerelease %s for normal startup validation",
435+
it.each(["0.148.0-alpha.9", "0.148.0-alpha.15", "0.148.0-alpha.23", "0.148.0", "1.0.0"])(
436+
"accepts a newer app-server version %s for normal startup validation",
441437
async (newerVersion) => {
442438
const warn = vi.spyOn(embeddedAgentLog, "warn").mockImplementation(() => undefined);
443439
const { harness, initializing, outbound } = startInitialize();
@@ -459,22 +455,6 @@ describe("CodexAppServerClient", () => {
459455
},
460456
);
461457

462-
it.each(["0.148.0-alpha.16", "0.148.0", "1.0.0"])(
463-
"blocks unverified future app-server version %s during initialize",
464-
async (version) => {
465-
const { harness, initializing, outbound } = startInitialize();
466-
harness.send({
467-
id: outbound.id,
468-
result: { userAgent: `openclaw/${version} (macOS; test)` },
469-
});
470-
471-
await expect(initializing).rejects.toThrow(
472-
`through ${MAX_SUPPORTED_CODEX_APP_SERVER_VERSION} is required`,
473-
);
474-
expect(harness.writes).toHaveLength(1);
475-
},
476-
);
477-
478458
it.each(["0.147.00", "0.148.0-alpha..9", "0.148.0-alpha.09"])(
479459
"blocks malformed app-server version %s during initialize",
480460
async (version) => {
@@ -485,7 +465,7 @@ describe("CodexAppServerClient", () => {
485465
});
486466

487467
await expect(initializing).rejects.toThrow(
488-
`A Codex app-server from ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} through ${MAX_SUPPORTED_CODEX_APP_SERVER_VERSION} is required`,
468+
`Codex app-server ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} or newer is required`,
489469
);
490470
expect(harness.writes).toHaveLength(1);
491471
},
@@ -496,7 +476,7 @@ describe("CodexAppServerClient", () => {
496476
harness.send({ id: outbound.id, result: {} });
497477

498478
await expect(initializing).rejects.toThrow(
499-
`A Codex app-server from ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} through ${MAX_SUPPORTED_CODEX_APP_SERVER_VERSION} is required`,
479+
`Codex app-server ${MIN_SUPPORTED_CODEX_APP_SERVER_VERSION} or newer is required`,
500480
);
501481
expect(harness.writes).toHaveLength(1);
502482
});

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

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

4036
const CODEX_APP_SERVER_PARSE_LOG_MAX = 500;
4137
const CODEX_APP_SERVER_PARSE_BUFFER_MAX = 8 * 1024 * 1024;
@@ -1004,7 +1000,7 @@ class CodexAppServerVersionError extends Error {
10041000
? `detected ${detectedVersion}`
10051001
: "OpenClaw could not determine the running Codex version";
10061002
super(
1007-
`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.`,
1003+
`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.`,
10081004
);
10091005
this.name = "CodexAppServerVersionError";
10101006
this.detectedVersion = detectedVersion;
@@ -1017,11 +1013,7 @@ function assertSupportedCodexAppServerVersion(response: CodexInitializeResponse)
10171013
throw new CodexAppServerVersionError(detectedVersion);
10181014
}
10191015
const detected = parseSemver(detectedVersion);
1020-
if (
1021-
!detected ||
1022-
detected.compare(MIN_SUPPORTED_CODEX_APP_SERVER_VERSION) < 0 ||
1023-
detected.compare(MAX_SUPPORTED_CODEX_APP_SERVER_VERSION) > 0
1024-
) {
1016+
if (!detected || detected.compare(MIN_SUPPORTED_CODEX_APP_SERVER_VERSION) < 0) {
10251017
throw new CodexAppServerVersionError(detectedVersion);
10261018
}
10271019
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)