openclaw - 💡(How to fix) Fix Codex app-server command execution closes before completion when code_mode_only is enabled

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Native Codex app-server command execution fails for me when OpenClaw starts Codex threads with features.code_mode_only=true. Removing only code_mode_only while keeping code_mode=true makes the same command smoke test pass.

Error Message

GatewayClientRequestError: codex app-server client closed before turn completed

Root Cause

Native Codex app-server command execution fails for me when OpenClaw starts Codex threads with features.code_mode_only=true. Removing only code_mode_only while keeping code_mode=true makes the same command smoke test pass.

Fix Action

Workaround

I configured plugins.entries.codex.config.appServer.command to a small wrapper that removes only features.code_mode_only from Codex thread/start and thread/resume JSON-RPC messages, while preserving features.code_mode=true.

With that wrapper restored, the same smoke test succeeds:

WRAPPER_OK:/Users/harveyspecter/openclaw/workspace

OpenClaw reports provider openai-codex, model gpt-5.5, harness codex, one bash tool call, and zero failures.

Code Example

agents.defaults.model.primary = "openai/gpt-5.5"
agents.defaults.model.fallbacks = []
agents.defaults.models["openai/gpt-5.5"].agentRuntime.id = "codex"
plugins.entries.codex.config.appServer = {
  mode: "yolo",
  transport: "stdio",
  requestTimeoutMs: 60000,
  turnCompletionIdleTimeoutMs: 60000
}

---

openclaw agent --session-id beta7-no-wrapper-command-smoke \
  --message "Run pwd and reply exactly NO_WRAPPER_OK:<pwd output>" \
  --thinking minimal --timeout 90 --json

---

GatewayClientRequestError: codex app-server client closed before turn completed

---

WRAPPER_OK:/Users/harveyspecter/openclaw/workspace
RAW_BUFFERClick to expand / collapse

Summary

Native Codex app-server command execution fails for me when OpenClaw starts Codex threads with features.code_mode_only=true. Removing only code_mode_only while keeping code_mode=true makes the same command smoke test pass.

Environment

  • OpenClaw: 2026.5.16-beta.7
  • Install: native macOS npm/global install, not Docker
  • Node: v22.22.1
  • Codex CLI: 0.130.0
  • Model: openai/gpt-5.5
  • Runtime: native Codex app-server via agentRuntime.id: "codex"
  • Telegram: polling connected
  • CLI/gateway/node host all confirmed on beta.7
  • openclaw doctor --lint --json --severity-min warning returns clean

Relevant config shape:

agents.defaults.model.primary = "openai/gpt-5.5"
agents.defaults.model.fallbacks = []
agents.defaults.models["openai/gpt-5.5"].agentRuntime.id = "codex"
plugins.entries.codex.config.appServer = {
  mode: "yolo",
  transport: "stdio",
  requestTimeoutMs: 60000,
  turnCompletionIdleTimeoutMs: 60000
}

Repro

With no app-server wrapper configured:

openclaw agent --session-id beta7-no-wrapper-command-smoke \
  --message "Run pwd and reply exactly NO_WRAPPER_OK:<pwd output>" \
  --thinking minimal --timeout 90 --json

Result:

GatewayClientRequestError: codex app-server client closed before turn completed

This also appears to affect Telegram usage when a turn needs command/tool execution.

Workaround

I configured plugins.entries.codex.config.appServer.command to a small wrapper that removes only features.code_mode_only from Codex thread/start and thread/resume JSON-RPC messages, while preserving features.code_mode=true.

With that wrapper restored, the same smoke test succeeds:

WRAPPER_OK:/Users/harveyspecter/openclaw/workspace

OpenClaw reports provider openai-codex, model gpt-5.5, harness codex, one bash tool call, and zero failures.

Direct app-server probe finding

Direct probes suggested:

  • no forced code mode: pwd works
  • features.code_mode=true: pwd works
  • features.code_mode=true plus features.code_mode_only=true: app-server emits a raw custom_tool_call and never reaches turn/completed

Question

Is features.code_mode_only=true expected to work with native Codex app-server command execution? If yes, what config am I missing? If no, is stripping code_mode_only while keeping code_mode=true a reasonable temporary workaround until this path is handled upstream?

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Codex app-server command execution closes before completion when code_mode_only is enabled