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
- Start an Atlas/Codex-native subagent through OpenClaw
sessions_spawn or an equivalent native Codex subagent flow.
- Let the subagent complete work that writes durable artifacts.
- Observe that the child/Codex thread is no longer active and artifacts exist on disk.
- Run
openclaw tasks audit --json and openclaw tasks list --runtime subagent --json.
- 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
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_runningbecause 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 --jsoncontinued to report a stale running task.openclaw tasks maintenancedid not reconcile it.Steps to reproduce
sessions_spawnor an equivalent native Codex subagent flow.openclaw tasks audit --jsonandopenclaw tasks list --runtime subagent --json.taskKind=codex-nativerow still markedrunningwithstale_running, often withlastEventAtnearstartedAt.Observed local example:
taskId=a02e5432-beec-43ad-af9d-ad182cb0f2c4subagent, task kind:codex-native, agent: Atlas / Codex-nativeatlas-registry-challenge-v1.mdandatlas-registry-proposal-v2.mdrunningfor 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 maintenanceshould detect stale Codex-native rows and either query/reconcile against the Codex thread status or mark the tasklost/needs_reconciliationwith a clear diagnostic instead of leaving it silentlyrunning.Actual behavior
running.lastEventAtdoes not reflect real progress/completion.openclaw tasks audit --jsonreportsstale_running.openclaw tasks maintenancedoes not reconcile the row.Impact
openclaw tasks auditcannot distinguish a real running task from completed-but-unfinalized Codex-native work.Workaround
Current local workaround is watcher-based:
openclaw tasks audit --jsonandopenclaw tasks list --runtime subagent --status running --json.running, manually reconcile after verifying artifacts.Related issues
stale_running.