openclaw - 💡(How to fix) Fix [Bug]: Native Codex PreToolUse hook relay becomes unavailable and blocks all native tools across turns

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…

In a Telegram direct session using the OpenAI Codex runtime, native tools began failing before execution with Native hook relay unavailable while chat and OpenClaw dynamic tools remained healthy.

Root Cause

In a Telegram direct session using the OpenAI Codex runtime, native tools began failing before execution with Native hook relay unavailable while chat and OpenClaw dynamic tools remained healthy.

Fix Action

Fix / Workaround

  1. In a Telegram direct OpenClaw session using the OpenAI Codex runtime, run a native shell command that writes and reads /tmp/openclaw_hook_test.txt.
  2. Observe the command succeeds and reads back hook ok.
  3. In the next turn, attempt to create/edit /tmp/openclaw_patch_test.txt using exec_command and/or apply_patch.
  4. Observe the native tool call is blocked before execution with Native hook relay unavailable.
  5. Attempt a harmless read-only shell command such as pwd.
  6. Observe it is also blocked before execution with Native hook relay unavailable.

Actual behavior exec_command, apply_patch, and even pwd were blocked before execution with Native hook relay unavailable. Telegram chat responses and OpenClaw dynamic tools such as session_status still worked.

Observed failures: Command blocked by PreToolUse hook: Native hook relay unavailable. Command: printf 'before ' > /tmp/openclaw_patch_test.txt Command blocked by PreToolUse hook: Native hook relay unavailable. Command: *** Begin Patch *** Add File: /tmp/openclaw_patch_test.txt +before *** End Patch Command blocked by PreToolUse hook: Native hook relay unavailable. Command: pwd

Code Example

Observed successful native command output:
cat /tmp/openclaw_hook_test.txt
hook ok

Observed failures:
Command blocked by PreToolUse hook: Native hook relay unavailable. Command: printf 'before
' > /tmp/openclaw_patch_test.txt
Command blocked by PreToolUse hook: Native hook relay unavailable. Command: *** Begin Patch
*** Add File: /tmp/openclaw_patch_test.txt
+before
*** End Patch
Command blocked by PreToolUse hook: Native hook relay unavailable. Command: pwd

Observed healthy OpenClaw dynamic tool status during failure:

OpenClaw 2026.5.26 (10ad3aa)
Runtime: OpenAI Codex
Execution: direct
Session: agent:main:main
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

In a Telegram direct session using the OpenAI Codex runtime, native tools began failing before execution with Native hook relay unavailable while chat and OpenClaw dynamic tools remained healthy.

Steps to reproduce

  1. In a Telegram direct OpenClaw session using the OpenAI Codex runtime, run a native shell command that writes and reads /tmp/openclaw_hook_test.txt.
  2. Observe the command succeeds and reads back hook ok.
  3. In the next turn, attempt to create/edit /tmp/openclaw_patch_test.txt using exec_command and/or apply_patch.
  4. Observe the native tool call is blocked before execution with Native hook relay unavailable.
  5. Attempt a harmless read-only shell command such as pwd.
  6. Observe it is also blocked before execution with Native hook relay unavailable.

Expected behavior

Expected behavior Based on the prior observed successful /tmp write/read in the same conversation, native tool calls should continue to execute or return normal command output across turns.

Actual behavior

Actual behavior exec_command, apply_patch, and even pwd were blocked before execution with Native hook relay unavailable. Telegram chat responses and OpenClaw dynamic tools such as session_status still worked.

OpenClaw version

OpenClaw 2026.5.26 (10ad3aa)

Operating system

Ubuntu 24.04.3

Install method

No response

Model

openai-codex/gpt-5.5

Provider / routing chain

Telegram direct chat -> OpenClaw gateway -> OpenAI Codex runtime

Additional provider/model setup details

Observed session status showed: execution direct, runtime OpenAI Codex, model openai-codex/gpt-5.5, auth profile oauth, session agent:main:main.

Logs, screenshots, and evidence

Observed successful native command output:
cat /tmp/openclaw_hook_test.txt
hook ok

Observed failures:
Command blocked by PreToolUse hook: Native hook relay unavailable. Command: printf 'before
' > /tmp/openclaw_patch_test.txt
Command blocked by PreToolUse hook: Native hook relay unavailable. Command: *** Begin Patch
*** Add File: /tmp/openclaw_patch_test.txt
+before
*** End Patch
Command blocked by PreToolUse hook: Native hook relay unavailable. Command: pwd

Observed healthy OpenClaw dynamic tool status during failure:

OpenClaw 2026.5.26 (10ad3aa)
Runtime: OpenAI Codex
Execution: direct
Session: agent:main:main

Impact and severity

Affected users/systems/channels: Telegram direct session using OpenAI Codex runtime with native tools enabled.

Severity: Blocks workflow. Native shell and file-edit tools cannot run.

Frequency: Observed across multiple turns after one successful /tmp write/read.

Consequence: The assistant can still chat, but cannot perform local shell/file work through native tools.

Additional information

Last good version for me was 2026.5.12. Before the successful /tmp write/read, gateway-spawned Codex stdio app-server and GitHub MCP child processes had reportedly been killed and the gateway restarted. After that, one native write/read succeeded, then later native tool calls failed before execution with Native hook relay unavailable.

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…

FAQ

Expected behavior

Expected behavior Based on the prior observed successful /tmp write/read in the same conversation, native tool calls should continue to execute or return normal command output across turns.

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 [Bug]: Native Codex PreToolUse hook relay becomes unavailable and blocks all native tools across turns