Repository navigation
Description
Summary
Native Codex subagents can start but fail every native tool call with:
Command blocked by PreToolUse hook: Native hook relay unavailable
This happened on OpenClaw 2026.6.1 (2e08f0f). The parent Codex session could still run native tools successfully in the same workspace, so this appears specific to native subagent hook relay registration/lifecycle rather than a global Gateway or shell failure.
Related/possibly duplicate: #87331. I attempted to add this as a supplemental comment there first, but GitHub returned Unable to create comment because issue is locked, so I am opening this as a fresh report with 2026.6.1 native-subagent evidence.
Environment
- OpenClaw:
2026.6.1 (2e08f0f) - OS: macOS
26.4.1/ Darwin25.4.0/ arm64 - Channel: Discord direct chat
- Runtime involved: native Codex parent session spawning native Codex subagents
- Node observed on host shell:
v24.16.0
Steps To Reproduce
- Use a native Codex parent session in a Discord direct chat.
- From the parent session, spawn native Codex subagents for read-only verification/audit work.
- In the subagents, attempt harmless native tool calls such as:
python3 -m py_compile <local-python-file>
rg -n "..." <local-python-file>
sed -n '1,260p' <local-python-file>
date- Observe that the parent session can still run native tools, while the subagents cannot.
Expected Behavior
Fresh native Codex subagents should receive a valid native hook relay registration and be able to run permitted native tools, or OpenClaw should surface a clearer recoverable state before the subagent begins work.
Actual Behavior
The subagents started, but every native tool call was blocked before execution with:
Command blocked by PreToolUse hook: Native hook relay unavailable
Both independently spawned subagents hit the same failure. They could not complete read-only verification/audit tasks.
Evidence
Sanitized subagent result excerpts:
BLOCKED: unable to run required read-only checks.
All shell commands were blocked with:
Command blocked by PreToolUse hook: Native hook relay unavailable
Unable to complete effective audit. All local read-only file/git/MCP attempts were blocked by OpenClaw hook:
Native hook relay unavailable
Local observations from the parent session:
- Gateway process was alive.
- Parent Codex session native tool calls worked.
- A native hook relay bridge registry directory existed with a current relay record.
- Native Codex subagent tool calls still failed closed with
Native hook relay unavailable.
I am intentionally not pasting local relay tokens, full private paths, or private task details.
Impact
This breaks multi-agent verification workflows. Parent work can proceed, but independent subagent review/test roles cannot inspect files or run harmless checks. Since the hook fails closed, this appears policy-safe, but it is user-visible and makes delegated audit/test roles unusable.
Suspected Cause / Fix Direction
This looks like the native Codex hook relay/session registration lifecycle. Fresh native subagents appear to receive or retain a relay reference that is unavailable/stale even while the parent session and Gateway remain usable.
What Was Tested
- Confirmed parent session could run native commands.
- Confirmed two fresh native Codex subagents both failed every harmless native tool call.
- Checked local OpenClaw troubleshooting docs, which identify
Native hook relay unavailableas a native Codex hook transport problem, not an ACP/acpx or shell-command failure. - Did not include private workspace paths, credentials, relay tokens, or project-specific data in this report.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jun 5, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 21, 2026, 10:45 AM ET / 14:45 UTC.
Summary
Keep open: current main and the latest release still preserve related native relay-unavailable fail-closed paths, the open related PR is not merged or proof-cleared, and the added sandboxed MCP catalog-loss report is not proven fixed.
Reproducibility: no. live high-confidence reproduction was run in this read-only review; source inspection shows the current relay-unavailable fail-closed paths and the issue has two external 2026.6.x reports. The full current-main native subagent plus sandboxed MCP path still needs a live run.
Ways to help us reproduce this
Next step
Manual review is needed because an open related PR already owns part of the relay fallback work, while the remaining MCP/subagent scope needs live reproduction and security/product direction.
Security
Needs attention: The issue is security-sensitive because the likely fix changes behavior around the native tool approval relay when the relay is unavailable.
Review details
Best possible solution:
Keep this issue open until a maintainer-proven fix restores native subagent tools and sandboxed MCP catalog visibility while preserving approval enforcement, either through #94870 plus extra proof or a narrower follow-up.
Do we have a high-confidence way to reproduce the issue?
No live high-confidence reproduction was run in this read-only review; source inspection shows the current relay-unavailable fail-closed paths and the issue has two external 2026.6.x reports. The full current-main native subagent plus sandboxed MCP path still needs a live run.
Is this the best way to solve the issue?
No, closing is not the best solution because current main and v2026.6.9 still contain related fail-closed behavior and the sandboxed MCP report is not proven fixed. The best path is maintainer review of the linked fallback work or a safer relay refresh design with live proof.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against 0ad48dad2c47.
Label changes
Label changes:
impact:security: The affected path is the native PreToolUse approval relay that gates shell, patch, and MCP tool execution.clawsweeper:needs-security-review: Current issue advisory state selects this label.Label justifications:
P1: The report describes delegated Codex subagents and sandboxed MCP tools becoming unusable for real workflows across multiple 2026.6.x reports.impact:session-state: The failure is tied to native Codex parent, subagent, and relay registration lifecycle state diverging.impact:security: The affected path is the native PreToolUse approval relay that gates shell, patch, and MCP tool execution.impact:other: The follow-up report adds sandboxed MCP tools missing from the Codex tool catalog despite the documented allowlist configuration.Evidence reviewed
Security concerns:
src/agents/harness/native-hook-relay.ts:798Current code fails closed for unknown unavailable PreToolUse relay state; any recovery path needs maintainer acceptance and proof that before_tool_call policy, trusted policy, loop detection, and approval prompts still run before native tools proceed.
Confidence: 0.86
What I checked:
src/agents/harness/native-hook-relay.ts:798, 0ad48dad2c47)extensions/codex/src/app-server/approval-bridge.ts:784, 0ad48dad2c47)src/cli/native-hook-relay-cli.test.ts:227, 0ad48dad2c47)extensions/codex/src/app-server/approval-bridge.ts:784, c645ec4555c0)docs/gateway/config-tools.md. (docs/gateway/config-tools.md:50, 0ad48dad2c47)Likely related people:
src/agents/harness/native-hook-relay.ts,src/cli/native-hook-relay-cli.ts,extensions/codex/src/app-server/native-hook-relay.ts)extensions/codex/src/app-server/native-hook-relay.ts,extensions/codex/src/app-server/run-attempt.ts,extensions/codex/src/app-server/session-binding.ts)src/cli/native-hook-relay-cli.ts,src/agents/harness/native-hook-relay.ts,extensions/codex/src/app-server/native-hook-relay.ts)extensions/codex/src/app-server/approval-bridge.ts,extensions/codex/src/app-server/native-hook-relay.ts,src/agents/harness/native-hook-relay.ts)src/agents/harness/native-hook-relay.ts,src/cli/native-hook-relay-cli.ts,extensions/codex/src/app-server/run-attempt.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.kweiner commentedon Jun 13, 2026
Confirming this still reproduces on OpenClaw 2026.6.5 (5181e4f) (Linux x64, systemd gateway, Slack channel, Codex/gpt-5.5), with an additional dimension: it blocks all MCP tools (
mcp.servers) for sandboxed agents and their subagents.Same signature in gateway logs:
In our setup, MCP tools never enter a sandboxed session's tool catalog at all, and the agent's subagents report no calendar/Google tools via
tool_search. Key isolation findings that may help:sandboxblock gets themcp__*tools (namespacemcp__<server>); switching that same agent tosandbox.mode: "all"makes them disappear entirely.bundle-mcptotools.sandbox.tools.alsoAllow(andtools.subagents.tools.alsoAllow) per the config-tools docs does not surface the MCP tools.sandbox.docker.network: "bridge", the container cancurlthe host MCP server directly (confirmed 200/health), yet the gateway still never initiates the MCP connection for that session — the HTTP MCP server logs zero requests from the session./new,/reset, gateway restart, and a full host reboot do not resolve it.openclaw doctorreports clean (no MCP/sandbox warning).So beyond native shell, the relay-registration lifecycle gap also takes out the entire MCP surface for sandboxed Codex sessions on 2026.6.x. Happy to provide full gateway logs or a minimal repro (one stdio
mcp.serversentry + onesandbox.mode: "all"agent).openclaw-barnacle commentedon Jul 6, 2026
This issue has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.
openclaw-barnacle commentedon Jul 14, 2026
Closing due to inactivity.
If this is still an issue, please retry on the latest OpenClaw release and share updated details.
If you are absolutely sure it still happens on the latest release, open a new issue with fresh steps to reproduce.