Skip to content

Native Codex subagents hit Native hook relay unavailable on 2026.6.1 while parent session works #90762

Closed as not planned

Description

@FelixStarlite

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 / Darwin 25.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

  1. Use a native Codex parent session in a Discord direct chat.
  2. From the parent session, spawn native Codex subagents for read-only verification/audit work.
  3. 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
  1. 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 unavailable as 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.

Activity

  1. clawsweeper commented on Jun 5, 2026

    @clawsweeper
    Contributor

    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

    • Add a screenshot or short recording showing the behavior.
    • Add expected vs actual behavior.
    • Include redacted logs or terminal output.

    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:

    • No live current-main run has proved whether native Codex subagents and sandboxed MCP catalog visibility still fail together.
    • The open related PR covers part of the stale relay family but is not merged, proof-cleared, or shown to fix the sandboxed MCP dimension.
    • Any relay-unavailable recovery can change native shell/tool approval enforcement unless maintainers accept and verify the fallback contract.

    Codex review notes: model internal, reasoning high; reviewed against 0ad48dad2c47.

    Label changes

    Label changes:

    • add impact:security: The affected path is the native PreToolUse approval relay that gates shell, patch, and MCP tool execution.
    • add 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:

    • [medium] Preserve native tool approval enforcement — src/agents/harness/native-hook-relay.ts:798
      Current 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:

    • Issue and follow-up reports: The issue reports OpenClaw 2026.6.1 native Codex subagents failing all native tool calls while the parent session works; a later comment confirms OpenClaw 2026.6.5 still reproduces and adds sandboxed MCP catalog loss despite documented allowlist configuration.
    • Current source still fail-closes unavailable PreToolUse: Current main renders an unavailable pre_tool_use relay as a block response unless the generated command explicitly recorded a no-policy noop marker. (src/agents/harness/native-hook-relay.ts:798, 0ad48dad2c47)
    • Current Codex app-server approval bridge blocks on relay invocation failure: When invokeNativeHookRelay throws, the app-server approval bridge returns a handled blocked outcome with the native relay unavailable message instead of falling through to generic policy evaluation. (extensions/codex/src/app-server/approval-bridge.ts:784, 0ad48dad2c47)
    • Current stale bridge test encodes no gateway fallback: The CLI test still asserts stale direct bridge errors do not fall back to the gateway and instead return Native hook relay unavailable for pre_tool_use and permission_request paths. (src/cli/native-hook-relay-cli.test.ts:227, 0ad48dad2c47)
    • Latest release still has the same fail-closed paths: Tag v2026.6.9 still contains the app-server relay-unavailable blocked catch and the stale direct-bridge unavailable return, so the central behavior is not proven shipped-fixed. (extensions/codex/src/app-server/approval-bridge.ts:784, c645ec4555c0)
    • Sandboxed MCP documented expectation: The docs say configured MCP servers are exposed under bundle-mcp and should be visible in sandboxed sessions when bundle-mcp, group:plugins, or matching MCP names are in tools.sandbox.tools.alsoAllow, which matches the reporter's claimed configured path. Public docs: docs/gateway/config-tools.md. (docs/gateway/config-tools.md:50, 0ad48dad2c47)

    Likely related people:

    • steipete: Authored and merged the no-policy native hook fallback work that preserved fail-closed behavior for unknown unavailable PreToolUse and PermissionRequest states across the central relay files. (role: fallback contract contributor and merger; confidence: high; commits: 76eb478ac9fe, fb64546d9e6f; files: src/agents/harness/native-hook-relay.ts, src/cli/native-hook-relay-cli.ts, extensions/codex/src/app-server/native-hook-relay.ts)
    • amknight: Authored the merged Codex native hook relay restart/generation preservation work that closed the earlier generation-staleness issue but did not prove this later subagent and MCP report fixed. (role: adjacent restart-generation contributor; confidence: high; commits: cf32aa86920a, 42e9504114f3; files: 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)
    • joshavant: Authored and merged recent native hook relay lifetime hardening across the CLI, harness, and Codex app-server relay paths. (role: recent native relay lifecycle contributor; confidence: medium; commits: 68dabb735245, 14b1ebd640c6; files: src/cli/native-hook-relay-cli.ts, src/agents/harness/native-hook-relay.ts, extensions/codex/src/app-server/native-hook-relay.ts)
    • Kaspre: Authored side-question native hook coverage that touched the app-server approval bridge, native hook relay integration, and harness relay path. (role: adjacent approval-path contributor; confidence: medium; commits: 69a0c925b890; files: extensions/codex/src/app-server/approval-bridge.ts, extensions/codex/src/app-server/native-hook-relay.ts, src/agents/harness/native-hook-relay.ts)
    • pash-openai: Earlier merged work kept Codex hook relays live across processes and turns, establishing much of the relay lifecycle surface involved here. (role: relay lifecycle contributor; confidence: medium; commits: 2541c940517a, 3b5dab372ac2; files: 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 keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. kweiner commented on Jun 13, 2026

    @kweiner

    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:

    [ws] ⇄ res ✗ nativeHook.invoke 0ms errorCode=INVALID_REQUEST errorMessage=native hook relay not found
    

    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:

    • Unsandboxed agents work; sandboxed ones never do. On the same gateway/config, an agent with no sandbox block gets the mcp__* tools (namespace mcp__<server>); switching that same agent to sandbox.mode: "all" makes them disappear entirely.
    • The documented sandbox exposure fix has no effect. Adding bundle-mcp to tools.sandbox.tools.alsoAllow (and tools.subagents.tools.alsoAllow) per the config-tools docs does not surface the MCP tools.
    • Not a network problem. With sandbox.docker.network: "bridge", the container can curl the 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 doctor reports 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.servers entry + one sandbox.mode: "all" agent).

  3. added
    P1High-priority user-facing bug, regression, or broken workflow.
    impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.
    impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.
    clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.
    on Jun 19, 2026
  4. openclaw-barnacle commented on Jul 6, 2026

    @openclaw-barnacle

    This issue has been automatically marked as stale due to inactivity.
    Please add updates or it will be closed.

  5. openclaw-barnacle commented on Jul 14, 2026

    @openclaw-barnacle

    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.

  6. locked as resolved and limited conversation to collaborators on Aug 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions