openclaw - 💡(How to fix) Fix Codex-native adapter silently misses subagent completion events, leaving task registry stale_running

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…

Codex-native subagent tasks can finish their work and write artifacts, but OpenClaw's task registry remains stuck at status=running / stale_running because the Codex-native adapter/task mirror silently misses the completion/status event.

This is distinct from a missing final text payload: in the observed case, the work was done and artifacts existed, but openclaw tasks audit --json continued to report a stale running task. openclaw tasks maintenance did not reconcile it.

Root Cause

Codex-native subagent tasks can finish their work and write artifacts, but OpenClaw's task registry remains stuck at status=running / stale_running because the Codex-native adapter/task mirror silently misses the completion/status event.

Fix Action

Workaround

Current local workaround is watcher-based:

  • Run a parent-side progress watcher that checks openclaw tasks audit --json and openclaw tasks list --runtime subagent --status running --json.
  • For Atlas/Codex-native tasks, prompt the child to write progress/completion checkpoints to a known durable file path or ticket artifact.
  • If the progress/artifact file shows completion while the task registry remains running, manually reconcile after verifying artifacts.
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (task registry/status incorrect without crash)

Summary

Codex-native subagent tasks can finish their work and write artifacts, but OpenClaw's task registry remains stuck at status=running / stale_running because the Codex-native adapter/task mirror silently misses the completion/status event.

This is distinct from a missing final text payload: in the observed case, the work was done and artifacts existed, but openclaw tasks audit --json continued to report a stale running task. openclaw tasks maintenance did not reconcile it.

Steps to reproduce

  1. Start an Atlas/Codex-native subagent through OpenClaw sessions_spawn or an equivalent native Codex subagent flow.
  2. Let the subagent complete work that writes durable artifacts.
  3. Observe that the child/Codex thread is no longer active and artifacts exist on disk.
  4. Run openclaw tasks audit --json and openclaw tasks list --runtime subagent --json.
  5. Observe a taskKind=codex-native row still marked running with stale_running, often with lastEventAt near startedAt.

Observed local example:

  • taskId=a02e5432-beec-43ad-af9d-ad182cb0f2c4
  • runtime: subagent, task kind: codex-native, agent: Atlas / Codex-native
  • Artifacts existed: atlas-registry-challenge-v1.md and atlas-registry-proposal-v2.md
  • Task registry stayed running for about 36h until manually reconciled.

Expected behavior

When a Codex-native subagent thread completes, OpenClaw should reliably finalize the corresponding task row as succeeded/failed/cancelled and update lastEventAt, endedAt, terminal_outcome, and progress/terminal summaries.

If the completion event is missed, openclaw tasks maintenance should detect stale Codex-native rows and either query/reconcile against the Codex thread status or mark the task lost / needs_reconciliation with a clear diagnostic instead of leaving it silently running.

Actual behavior

  • Work completes and artifacts are present.
  • The Codex-native task row remains running.
  • lastEventAt does not reflect real progress/completion.
  • openclaw tasks audit --json reports stale_running.
  • openclaw tasks maintenance does not reconcile the row.
  • Operator must manually inspect artifacts and update/reconcile the task registry.

Impact

  • Long-running agent monitoring becomes unreliable.
  • Parent/operator sees stale active work and may wait indefinitely or duplicate work.
  • Automation that depends on openclaw tasks audit cannot distinguish a real running task from completed-but-unfinalized Codex-native work.
  • Orchestration/lifecycle evidence is weakened because task terminal state no longer matches actual worker state.

Workaround

Current local workaround is watcher-based:

  • Run a parent-side progress watcher that checks openclaw tasks audit --json and openclaw tasks list --runtime subagent --status running --json.
  • For Atlas/Codex-native tasks, prompt the child to write progress/completion checkpoints to a known durable file path or ticket artifact.
  • If the progress/artifact file shows completion while the task registry remains running, manually reconcile after verifying artifacts.

Related issues

  • Related but distinct: #82233 tracks subagent result/announce payload loss and was closed as duplicate of #75196.
  • Related canonical result-payload issue: #75196.
  • This issue is specifically about Codex-native task registry status mirroring/reconciliation: completed work remains stale_running.

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

When a Codex-native subagent thread completes, OpenClaw should reliably finalize the corresponding task row as succeeded/failed/cancelled and update lastEventAt, endedAt, terminal_outcome, and progress/terminal summaries.

If the completion event is missed, openclaw tasks maintenance should detect stale Codex-native rows and either query/reconcile against the Codex thread status or mark the task lost / needs_reconciliation with a clear diagnostic instead of leaving it silently running.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING