openclaw - 💡(How to fix) Fix [Bug]: Codex-native subagent completes as BLOCKED but remains running when native hook relay is unavailable [1 pull requests]

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…

Issue Summary

After updating to OpenClaw 2026.5.18, Codex-native subagents can return a terminal completion to the parent chat but remain marked as running in OpenClaw’s task registry.

In testing, the subagent completed with:

BLOCKED Native hook relay unavailable

However, openclaw tasks list --runtime subagent --status running still showed the same subagent as running, with progress stuck at:

Codex native subagent is initializing.

This reproduced both before and after a clean Gateway restart. Manual cancellation was required to remove the stale running task.

The core issue appears to be a mismatch between Codex-native subagent terminal events and OpenClaw’s task lifecycle tracking: the parent session receives the terminal blocked result, but the task registry does not reconcile the task to a terminal state.

Error Message

  • If the native hook relay is unavailable, OpenClaw should either fail the spawn early with a clear error or immediately close the subagent task as blocked/failed.

Root Cause

This issue can cause Codex-native subagents to remain marked as running after they have already returned a terminal blocked result. Because the task registry does not close them automatically, users may continue seeing active subagent tasks and potentially continued Codex usage until the tasks are manually cancelled.

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

Issue Summary

After updating to OpenClaw 2026.5.18, Codex-native subagents can return a terminal completion to the parent chat but remain marked as running in OpenClaw’s task registry.

In testing, the subagent completed with:

BLOCKED Native hook relay unavailable

However, openclaw tasks list --runtime subagent --status running still showed the same subagent as running, with progress stuck at:

Codex native subagent is initializing.

This reproduced both before and after a clean Gateway restart. Manual cancellation was required to remove the stale running task.

The core issue appears to be a mismatch between Codex-native subagent terminal events and OpenClaw’s task lifecycle tracking: the parent session receives the terminal blocked result, but the task registry does not reconcile the task to a terminal state.

Steps to reproduce

Steps to Reproduce

  1. Update to OpenClaw 2026.5.18.

  2. Start from a Discord channel session using a Codex/OpenAI-backed agent.

  3. Spawn a tiny Codex-native subagent with a harmless read-only task, for example: Check the current working directory if local tools are available, then return PASS or BLOCKED.

  4. Wait for the subagent completion to return to the parent chat.

  5. Observe that the parent chat receives a terminal blocked completion similar to: BLOCKED Native hook relay unavailable

  6. Check the subagent task registry: openclaw tasks list --runtime subagent --status running --json

  7. Observe that the completed/blocked subagent is still listed as running.

  8. Observe that its progress summary may still show: Codex native subagent is initializing.

  9. Manually cancel the stale task: openclaw tasks cancel <task_id>

  10. Re-run the running task check and confirm it only clears after manual cancellation: openclaw tasks list --runtime subagent --status running --json

This reproduced both before and after a clean Gateway restart.

Expected behavior

Expected Behavior

When a Codex-native subagent reaches any terminal state, OpenClaw should update the task registry to match that terminal state automatically.

Specifically:

  • If the parent chat receives a terminal subagent completion, the task should no longer appear in openclaw tasks list --runtime subagent --status running.
  • Terminal outcomes should include successful completion, blocked completion, tool/hook failure, timeout, cancellation, and errored states.
  • A subagent that reports BLOCKED Native hook relay unavailable should be marked as blocked or failed, not left as running.
  • The task progress summary should not remain stuck at Codex native subagent is initializing after a terminal completion has already been delivered.
  • Manual cancellation should not be required to stop token usage or clear the running task list after a terminal subagent result.
  • If the native hook relay is unavailable, OpenClaw should either fail the spawn early with a clear error or immediately close the subagent task as blocked/failed.

In short: once OpenClaw emits or delivers a terminal subagent result, the task registry should reconcile that task to a terminal status and remove it from the running queue.

Actual behavior

Actual Behavior

Codex-native subagents return a terminal result to the parent chat, but OpenClaw does not update the task registry to a terminal state.

In the reproduced case:

  • The parent chat received a completion from the subagent.
  • The completion was terminal and reported: BLOCKED Native hook relay unavailable.
  • Despite that terminal result, the subagent still appeared in: openclaw tasks list --runtime subagent --status running --json
  • The stale task continued to show as running.
  • Its progress summary remained stuck at: Codex native subagent is initializing.
  • The task did not clear automatically after completion.
  • A manual openclaw tasks cancel <task_id> was required to remove it from the running queue.

This behavior persisted after restarting the Gateway and rerunning the same small subagent smoke test.

OpenClaw version

2026.5.18

Operating system

Ubuntu 24.04 LTS

Install method

Npm global

Model

Codex GPT 5.5

Provider / routing chain

Discord channel session → OpenClaw Gateway → Codex-native subagent / OpenAI GPT-5.5

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

Impact and Severity

Severity: High

This issue can cause Codex-native subagents to remain marked as running after they have already returned a terminal blocked result. Because the task registry does not close them automatically, users may continue seeing active subagent tasks and potentially continued Codex usage until the tasks are manually cancelled.

Observed impact:

  • Failed or blocked subagents remain in the running queue.
  • Manual cancellation is required to clear stale subagent tasks.
  • Users may not realize token/model usage is still active or being tracked as active.
  • Running task state becomes unreliable after a terminal subagent completion.
  • Automated workflows that spawn subagents could accumulate stale running tasks.
  • This makes it risky to use Codex-native subagents for normal delegated work without manual cleanup checks.

The issue is especially concerning because the parent chat receives a terminal completion, which makes the task appear finished from the user’s perspective, while OpenClaw still reports it as running internally.

Additional information

No response

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

When a Codex-native subagent reaches any terminal state, OpenClaw should update the task registry to match that terminal state automatically.

Specifically:

  • If the parent chat receives a terminal subagent completion, the task should no longer appear in openclaw tasks list --runtime subagent --status running.
  • Terminal outcomes should include successful completion, blocked completion, tool/hook failure, timeout, cancellation, and errored states.
  • A subagent that reports BLOCKED Native hook relay unavailable should be marked as blocked or failed, not left as running.
  • The task progress summary should not remain stuck at Codex native subagent is initializing after a terminal completion has already been delivered.
  • Manual cancellation should not be required to stop token usage or clear the running task list after a terminal subagent result.
  • If the native hook relay is unavailable, OpenClaw should either fail the spawn early with a clear error or immediately close the subagent task as blocked/failed.

In short: once OpenClaw emits or delivers a terminal subagent result, the task registry should reconcile that task to a terminal status and remove it from the running queue.

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]: Codex-native subagent completes as BLOCKED but remains running when native hook relay is unavailable [1 pull requests]