Skip to content

Codex command executions lose streamed output when aggregatedOutput is empty #83199

@rozmiarD

Description

@rozmiarD

Summary

OpenClaw's Codex app-server event projector currently uses commandExecution.aggregatedOutput as the only output source for final command tool results. Some Codex command runs emit stdout through item/commandExecution/outputDelta, but the final commandExecution snapshot can still have aggregatedOutput: null or an empty value.

When that happens, OpenClaw records a completed bash tool result with no output. In the UI this can look like the run is stuck at Tool: bash or like it completed successfully with No output, even though stdout was streamed earlier.

Reproduction shape

  1. Run a Codex-backed OpenClaw session.
  2. Execute a command that emits stdout through item/commandExecution/outputDelta.
  3. Have the final commandExecution item arrive with aggregatedOutput: null.
  4. Build the final transcript/result snapshot.

Actual behavior

The final command tool result/transcript output is empty because OpenClaw only reads aggregatedOutput for commandExecution items.

Expected behavior

OpenClaw should preserve streamed outputDelta text and use it as a fallback final output when aggregatedOutput is missing or empty.

Impact

The user and subsequent agent context can lose the actual command output. This makes successful commands look empty and can make the UI appear stuck around Tool: bash, especially for commands whose useful result is printed to stdout.

Version check

I checked the current published stable package, the current npm beta, and upstream main; the issue still appears to be present in all of them.

Related work

#70966 improved verbose Codex tool logs, but it does not cover the final transcript/result fallback when aggregatedOutput is empty.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions