Skip to content

Commit 60d200f

Browse files
vincentkocrozmiarD
andauthored
fix(codex): make post-tool raw assistant timeout configurable (#84974)
* fix(codex): make post-tool raw assistant timeout configurable * docs(codex): align post-tool assistant timeout docs * docs(changelog): move codex timeout note to unreleased --------- Co-authored-by: 0x505badc0de <32790662+rozmiarD@users.noreply.github.com>
1 parent 7f4bd45 commit 60d200f

8 files changed

Lines changed: 219 additions & 43 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Docs: https://docs.openclaw.ai
5151
- Providers/Ollama: preserve native Ollama tool-call IDs across assistant replay so Gemini over Ollama Cloud can keep its hidden function-call thought-signature handle.
5252
- Discord: keep session recovery and `/stop` abort ownership on the source dispatch lane while bound ACP turns continue routing to their target session, so stalled pre-run work and late replies are cleared instead of leaking after stop. Fixes #84477. (#85100) Thanks @joshavant.
5353
- Codex app-server: mark missing turn completion after observed execution as replay-unsafe and release the session so follow-up turns can run. Fixes #84076. (#85107) Thanks @joshavant.
54+
- Codex app-server: add a dedicated post-tool raw assistant completion idle timeout config so trusted heavy turns can wait longer after tool handoff without weakening final assistant release.
5455
- Matrix: keep explicitly configured two-person rooms on the room route before stale `m.direct` or strict two-member DM fallback can bypass mention gating. Fixes #85017. (#85137) Thanks @joshavant.
5556
- PDF tool: time out idle remote PDF body reads after 120 seconds so stalled remote documents return an error instead of wedging the session. Fixes #68649. (#84768) Thanks @luoyanglang.
5657
- Diagnostics/OpenTelemetry plugin: suppress handled OTLP exporter promise rejections so collector shutdowns no longer crash the Gateway. (#81085) Thanks @luoyanglang.

docs/plugins/codex-harness-reference.md

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -85,24 +85,25 @@ For an already-running app-server, use WebSocket transport:
8585

8686
Supported `appServer` fields:
8787

88-
| Field | Default | Meaning |
89-
| -------------------------------- | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
90-
| `transport` | `"stdio"` | `"stdio"` spawns Codex; `"websocket"` connects to `url`. |
91-
| `command` | managed Codex binary | Executable for stdio transport. Leave unset to use the managed binary. |
92-
| `args` | `["app-server", "--listen", "stdio://"]` | Arguments for stdio transport. |
93-
| `url` | unset | WebSocket app-server URL. |
94-
| `authToken` | unset | Bearer token for WebSocket transport. |
95-
| `headers` | `{}` | Extra WebSocket headers. |
96-
| `clearEnv` | `[]` | Extra environment variable names removed from the spawned stdio app-server process after OpenClaw builds its inherited environment. |
97-
| `requestTimeoutMs` | `60000` | Timeout for app-server control-plane calls. |
98-
| `turnCompletionIdleTimeoutMs` | `60000` | Quiet window after Codex accepts a turn or after a turn-scoped app-server request while OpenClaw waits for `turn/completed`. |
99-
| `mode` | `"yolo"` unless local Codex requirements disallow YOLO | Preset for YOLO or guardian-reviewed execution. |
100-
| `approvalPolicy` | `"never"` or an allowed guardian approval policy | Native Codex approval policy sent to thread start, resume, and turn. |
101-
| `sandbox` | `"danger-full-access"` or an allowed guardian sandbox | Native Codex sandbox mode sent to thread start and resume when OpenClaw sandboxing is inactive. Active OpenClaw sandboxes disable native Code Mode instead of relying on Codex host-side sandboxing. |
102-
| `approvalsReviewer` | `"user"` or an allowed guardian reviewer | Use `"auto_review"` to let Codex review native approval prompts when allowed. |
103-
| `defaultWorkspaceDir` | current process directory | Workspace used by `/codex bind` when `--cwd` is omitted. |
104-
| `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"`. |
105-
| `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. |
88+
| Field | Default | Meaning |
89+
| --------------------------------------------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
90+
| `transport` | `"stdio"` | `"stdio"` spawns Codex; `"websocket"` connects to `url`. |
91+
| `command` | managed Codex binary | Executable for stdio transport. Leave unset to use the managed binary. |
92+
| `args` | `["app-server", "--listen", "stdio://"]` | Arguments for stdio transport. |
93+
| `url` | unset | WebSocket app-server URL. |
94+
| `authToken` | unset | Bearer token for WebSocket transport. |
95+
| `headers` | `{}` | Extra WebSocket headers. |
96+
| `clearEnv` | `[]` | Extra environment variable names removed from the spawned stdio app-server process after OpenClaw builds its inherited environment. |
97+
| `requestTimeoutMs` | `60000` | Timeout for app-server control-plane calls. |
98+
| `turnCompletionIdleTimeoutMs` | `60000` | Quiet window after Codex accepts a turn or after a turn-scoped app-server request while OpenClaw waits for `turn/completed`. |
99+
| `postToolRawAssistantCompletionIdleTimeoutMs` | unset | Completion-idle guard used after a tool handoff when Codex emits raw assistant completion or progress but does not send `turn/completed`. Defaults to the assistant completion idle timeout when unset. Use this for trusted or heavy workloads where post-tool synthesis can legitimately stay quiet longer than the final assistant release budget. |
100+
| `mode` | `"yolo"` unless local Codex requirements disallow YOLO | Preset for YOLO or guardian-reviewed execution. |
101+
| `approvalPolicy` | `"never"` or an allowed guardian approval policy | Native Codex approval policy sent to thread start, resume, and turn. |
102+
| `sandbox` | `"danger-full-access"` or an allowed guardian sandbox | Native Codex sandbox mode sent to thread start and resume. Active OpenClaw sandboxes narrow `danger-full-access` turns to Codex `workspace-write`; the turn network flag follows OpenClaw sandbox egress. |
103+
| `approvalsReviewer` | `"user"` or an allowed guardian reviewer | Use `"auto_review"` to let Codex review native approval prompts when allowed. |
104+
| `defaultWorkspaceDir` | current process directory | Workspace used by `/codex bind` when `--cwd` is omitted. |
105+
| `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"`. |
106+
| `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. |
106107

107108
The plugin blocks older or unversioned app-server handshakes. Codex app-server
108109
must report stable version `0.125.0` or newer.
@@ -330,9 +331,12 @@ turn-scoped tool-result handoff. Completed `agentMessage` items and pre-tool raw
330331
assistant `rawResponseItem/completed` items arm the assistant-output release: if
331332
Codex then goes quiet without `turn/completed`, OpenClaw best-effort interrupts
332333
the native turn and releases the session lane. Post-tool raw assistant progress
333-
keeps waiting for `turn/completed` or the terminal watchdog. Timeout diagnostics
334-
include the last app-server notification method and, for raw assistant response
335-
items, the item type, role, id, and a bounded assistant text preview.
334+
keeps waiting for `turn/completed` while a completion-idle guard stays armed; the
335+
guard uses `appServer.postToolRawAssistantCompletionIdleTimeoutMs` when
336+
configured and falls back to the assistant completion idle timeout otherwise.
337+
Timeout diagnostics include the last app-server notification method and, for raw
338+
assistant response items, the item type, role, id, and a bounded assistant text
339+
preview.
336340

337341
## Model discovery
338342

0 commit comments

Comments
 (0)