Skip to content

Commit e5798e5

Browse files
authored
refactor(codex): raise app-server floor to 0.142, drop range compat, fix deferred spawn_agent steering (#101221)
* refactor(codex): raise app-server floor to 0.142 and drop range-compat protocol paths * refactor(codex): model subagent mirror state as one map * style(codex): format event-projector * test(codex): drop unused shared-client test import * refactor(codex): drop v1-era notification field aliases * fix(codex): teach models to load deferred native spawn_agent via tool_search * docs(codex): realign harness config tables * docs(changelog): note Codex app-server protocol update
1 parent 1ef4544 commit e5798e5

37 files changed

Lines changed: 195 additions & 527 deletions

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Docs: https://docs.openclaw.ai
2323

2424
### Fixes
2525

26+
- **Codex app-server protocol:** require app-server 0.142 or newer, remove pre-0.142 wire-shape compatibility, and teach Codex to retrieve deferred native `spawn_agent` through `tool_search` so native subagent task mirroring works on search-capable models. (#101221)
2627
- **Android hardware keyboard chat:** send with unmodified Enter on physical keyboards while preserving Shift+Enter and other modified Enter combinations for multiline input. (#101239) Thanks @3ninyt3nin-creator.
2728
- **CJK Markdown emphasis:** render adjacent Chinese, Japanese, and Korean emphasis punctuation through the shared Markdown pipeline instead of leaking literal markers across channels. (#101230, #101120) Thanks @nicknmorty.
2829
- **Codex yielded native subagents:** keep the parent app-server subscription and shared client alive until yielded native subagent completion delivery settles, preventing lost wakeups and leaked one-shot cleanup.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ For an already-running app-server, use WebSocket transport:
105105
| `defaultWorkspaceDir` | current process directory | Workspace used by `/codex bind` when `--cwd` is omitted. |
106106
| `serviceTier` | unset | Optional Codex app-server service tier. `"priority"` enables fast-mode routing, `"flex"` requests flex processing, and `null` clears the override. Legacy `"fast"` is accepted as `"priority"`. |
107107
| `networkProxy` | disabled | Opt into Codex permissions-profile networking for app-server commands. OpenClaw defines the selected `permissions.<profile>.network` config and selects it with `default_permissions` instead of sending `sandbox`. |
108-
| `experimental.sandboxExecServer` | `false` | Preview opt-in that registers an OpenClaw sandbox-backed Codex environment with Codex app-server 0.132.0 or newer so native Codex execution can run inside the active OpenClaw sandbox. |
108+
| `experimental.sandboxExecServer` | `false` | Preview opt-in that registers an OpenClaw sandbox-backed Codex environment with the supported Codex app-server so native Codex execution can run inside the active OpenClaw sandbox. |
109109

110110
`appServer.networkProxy` is explicit because it changes the Codex sandbox
111111
contract. When enabled, OpenClaw also sets `features.network_proxy.enabled` and
@@ -146,7 +146,7 @@ permission profile instead. Codex-managed network enforcement is sandboxed
146146
networking, so a full-access profile would not protect outbound traffic.
147147

148148
The plugin blocks older or unversioned app-server handshakes: Codex app-server
149-
must report stable version `0.125.0` or newer.
149+
must report stable version `0.142.0` or newer.
150150

151151
OpenClaw treats non-loopback WebSocket app-server URLs as remote and requires
152152
identity-bearing WebSocket auth through `appServer.authToken` or an
@@ -237,7 +237,7 @@ The stable default is fail-closed: active OpenClaw sandboxing disables native
237237
Codex execution surfaces that would otherwise run from the Codex app-server
238238
host. Use `appServer.experimental.sandboxExecServer: true` only when you want
239239
to try Codex's remote environment support with OpenClaw's sandbox backend.
240-
This preview path requires Codex app-server 0.132.0 or newer.
240+
This preview path works with every supported Codex app-server version.
241241

242242
```json5
243243
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Supported in Codex runtime v1:
125125
| Dynamic tool hooks | Supported | `before_tool_call`, `after_tool_call`, and tool-result middleware run around OpenClaw-owned dynamic tools. |
126126
| Lifecycle hooks | Supported as adapter observations | `llm_input`, `llm_output`, `agent_end`, `before_compaction`, and `after_compaction` fire with honest Codex-mode payloads. |
127127
| Final-answer revision gate | Supported through native hook relay | Codex `Stop` is relayed to `before_agent_finalize`; `revise` asks Codex for one more model pass before finalization. |
128-
| Native shell, patch, and MCP block or observe | Supported through native hook relay | Codex `PreToolUse` and `PostToolUse` are relayed for committed native tool surfaces, including MCP payloads on Codex app-server `0.125.0` or newer. Blocking is supported; argument rewriting is not. |
128+
| Native shell, patch, and MCP block or observe | Supported through native hook relay | Codex `PreToolUse` and `PostToolUse` are relayed for committed native tool surfaces, including MCP payloads on Codex app-server `0.142.0` or newer. Blocking is supported; argument rewriting is not. |
129129
| Native permission policy | Supported through Codex app-server approvals and compatibility native hook relay | Codex app-server approval requests route through OpenClaw after Codex review. The `PermissionRequest` native hook relay is opt-in for native approval modes because Codex emits it before guardian review. |
130130
| App-server trajectory capture | Supported | OpenClaw records the request it sent to app-server and the app-server notifications it receives. |
131131

‎docs/plugins/codex-harness.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ channel is the communication surface.
3838

3939
- OpenClaw with the bundled `codex` plugin available. Include `codex` in
4040
`plugins.allow` if your config uses an allowlist.
41-
- Codex app-server `0.125.0` or newer. The plugin manages a compatible
41+
- Codex app-server `0.142.0` or newer. The plugin manages a compatible
4242
binary by default, so a `codex` command on `PATH` does not affect normal
4343
startup.
4444
- Codex auth through `openclaw models auth login --provider openai`, an
@@ -638,7 +638,7 @@ Supported `appServer` fields:
638638
| `approvalsReviewer` | `"user"` or an allowed guardian reviewer | Use `"auto_review"` to let Codex review native approval prompts when allowed, otherwise `guardian_subagent` or `user`. `guardian_subagent` remains a legacy alias. |
639639
| `serviceTier` | unset | Optional Codex app-server service tier. `"priority"` enables fast-mode routing, `"flex"` requests flex processing, `null` clears the override, and legacy `"fast"` is accepted as `"priority"`. |
640640
| `networkProxy` | disabled | Opt into Codex permissions-profile networking for app-server commands. OpenClaw defines the selected `permissions.<profile>.network` config and selects it with `default_permissions` instead of sending `sandbox`. |
641-
| `experimental.sandboxExecServer` | `false` | Preview opt-in that registers an OpenClaw sandbox-backed Codex environment with Codex app-server 0.132.0 or newer so native Codex execution can run inside the active OpenClaw sandbox. |
641+
| `experimental.sandboxExecServer` | `false` | Preview opt-in that registers an OpenClaw sandbox-backed Codex environment with the supported Codex app-server so native Codex execution can run inside the active OpenClaw sandbox. |
642642

643643
`appServer.networkProxy` is explicit because it changes the Codex sandbox
644644
contract. When enabled, OpenClaw also sets `features.network_proxy.enabled`
@@ -900,10 +900,10 @@ instead of a plain OpenAI API-key failure.
900900
Doctor rewrites legacy model refs to `openai/*`, removes stale session and
901901
whole-agent runtime pins, and preserves existing auth-profile overrides.
902902

903-
**The app-server is rejected:** use Codex app-server `0.125.0` or newer.
903+
**The app-server is rejected:** use Codex app-server `0.142.0` or newer.
904904
Same-version prereleases or build-suffixed versions such as
905-
`0.125.0-alpha.2` or `0.125.0+custom` are rejected because OpenClaw tests
906-
the stable `0.125.0` protocol floor.
905+
`0.142.0-alpha.2` or `0.142.0+custom` are rejected because OpenClaw tests
906+
the stable `0.142.0` protocol floor.
907907

908908
**`/codex status` cannot connect:** check that the bundled `codex` plugin
909909
is enabled, that `plugins.allow` includes it when an allowlist is

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ for compatibility.
154154
For operator setup, model prefix examples, and Codex-only configs, see
155155
[Codex Harness](/plugins/codex-harness).
156156

157-
OpenClaw requires Codex app-server `0.125.0` or newer. The Codex plugin checks
157+
OpenClaw requires Codex app-server `0.142.0` or newer. The Codex plugin checks
158158
the app-server initialize handshake and blocks older or unversioned servers,
159159
so OpenClaw only runs against the protocol surface it has tested.
160160

‎extensions/codex/media-understanding-provider.test.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ describe("codex media understanding provider", () => {
254254
dynamicTools: [],
255255
experimentalRawEvents: true,
256256
ephemeral: true,
257-
persistExtendedHistory: false,
258257
});
259258
expect(requests[2]?.params).toEqual({
260259
threadId: "thread-1",
@@ -546,7 +545,6 @@ describe("codex media understanding provider", () => {
546545
dynamicTools: [],
547546
experimentalRawEvents: true,
548547
ephemeral: true,
549-
persistExtendedHistory: false,
550548
});
551549
const turnParams = requests[2]?.params as
552550
| {

‎extensions/codex/src/app-server/approval-bridge.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,7 @@ function matchesCurrentTurn(
330330
if (!requestParams) {
331331
return false;
332332
}
333-
const requestThreadId =
334-
readString(requestParams, "threadId") ?? readString(requestParams, "conversationId");
333+
const requestThreadId = readString(requestParams, "threadId");
335334
const requestTurnId = readString(requestParams, "turnId");
336335
return requestThreadId === threadId && requestTurnId === turnId;
337336
}

‎extensions/codex/src/app-server/attempt-startup.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ async function answerInitialize(harness: ClientHarness): Promise<void> {
142142
timeout: HARNESS_REQUEST_TIMEOUT_MS,
143143
});
144144
const initialize = JSON.parse(harness.writes[0] ?? "{}") as { id?: number };
145-
harness.send({ id: initialize.id, result: { userAgent: "openclaw/0.125.0 (macOS; test)" } });
145+
harness.send({ id: initialize.id, result: { userAgent: "openclaw/0.142.0 (macOS; test)" } });
146146
}
147147

148148
async function waitForRequest(

‎extensions/codex/src/app-server/bounded-turn.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ async function runBoundedCodexAppServerTurnInWorkspace(
168168
environments: [],
169169
dynamicTools: [],
170170
experimentalRawEvents: true,
171-
persistExtendedHistory: false,
172171
ephemeral: true,
173172
} satisfies CodexThreadStartParams,
174173
{ timeoutMs, signal: abortController.signal },

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ describe("CodexAppServerClient", () => {
224224
const { harness, initializing, outbound } = startInitialize();
225225
harness.send({
226226
id: outbound.id,
227-
result: { userAgent: "openclaw/0.125.0 (macOS; test)" },
227+
result: { userAgent: "openclaw/0.142.0 (macOS; test)" },
228228
});
229229

230230
await expect(initializing).resolves.toBeUndefined();
@@ -263,11 +263,11 @@ describe("CodexAppServerClient", () => {
263263
const { harness, initializing, outbound } = startInitialize();
264264
harness.send({
265265
id: outbound.id,
266-
result: { userAgent: "openclaw/0.125.0-alpha.2 (macOS; test)" },
266+
result: { userAgent: "openclaw/0.142.0-alpha.2 (macOS; test)" },
267267
});
268268

269269
await expect(initializing).rejects.toThrow(
270-
`Codex app-server ${MIN_CODEX_APP_SERVER_VERSION} or newer is required, but detected 0.125.0-alpha.2`,
270+
`Codex app-server ${MIN_CODEX_APP_SERVER_VERSION} or newer is required, but detected 0.142.0-alpha.2`,
271271
);
272272
expect(harness.writes).toHaveLength(1);
273273
});
@@ -276,11 +276,11 @@ describe("CodexAppServerClient", () => {
276276
const { harness, initializing, outbound } = startInitialize();
277277
harness.send({
278278
id: outbound.id,
279-
result: { userAgent: "openclaw/0.125.0+alpha.2 (macOS; test)" },
279+
result: { userAgent: "openclaw/0.142.0+alpha.2 (macOS; test)" },
280280
});
281281

282282
await expect(initializing).rejects.toThrow(
283-
`Codex app-server ${MIN_CODEX_APP_SERVER_VERSION} or newer is required, but detected 0.125.0+alpha.2`,
283+
`Codex app-server ${MIN_CODEX_APP_SERVER_VERSION} or newer is required, but detected 0.142.0+alpha.2`,
284284
);
285285
expect(harness.writes).toHaveLength(1);
286286
});
@@ -289,7 +289,7 @@ describe("CodexAppServerClient", () => {
289289
const { harness, initializing, outbound } = startInitialize();
290290
harness.send({
291291
id: outbound.id,
292-
result: { userAgent: "openclaw/0.126.0-alpha.1 (macOS; test)" },
292+
result: { userAgent: "openclaw/0.143.0-alpha.1 (macOS; test)" },
293293
});
294294

295295
await expect(initializing).resolves.toBeUndefined();
@@ -300,7 +300,7 @@ describe("CodexAppServerClient", () => {
300300
const { harness, initializing, outbound } = startInitialize();
301301
harness.send({
302302
id: outbound.id,
303-
result: { userAgent: "openclaw/0.126.0+custom (macOS; test)" },
303+
result: { userAgent: "openclaw/0.143.0+custom (macOS; test)" },
304304
});
305305

306306
await expect(initializing).resolves.toBeUndefined();
@@ -452,7 +452,7 @@ describe("CodexAppServerClient", () => {
452452

453453
it("reads the Codex version from the app-server user agent", () => {
454454
expect(readCodexVersionFromUserAgent("Codex Desktop/0.125.0")).toBe("0.125.0");
455-
expect(readCodexVersionFromUserAgent("openclaw/0.125.0 (macOS; test)")).toBe("0.125.0");
455+
expect(readCodexVersionFromUserAgent("openclaw/0.142.0 (macOS; test)")).toBe("0.142.0");
456456
expect(readCodexVersionFromUserAgent("codex_cli_rs/0.125.0-dev (linux; test)")).toBe(
457457
"0.125.0-dev",
458458
);

0 commit comments

Comments
 (0)