Skip to content

Webchat tool streaming not working - exec output only shows after completion #6446

@berkay123001

Description

@berkay123001

Issue

Tool streaming does not work in webchat. Terminal output is only shown after command completes, not in real-time.

Expected Behavior

When running exec commands, output should stream in real-time as the command produces it.

Actual Behavior

  • Backend: spawn is used, emitUpdate() is called
  • Framework: tool_execution_update events are produced
  • Frontend/WebSocket: Only tool_execution_end is sent (bulk output)
  • Result: User sees output only after completion, not streaming

Impact

  • Long-running commands appear to "freeze" the UI
  • Real-time feedback is missing
  • User experience is degraded

Environment

  • OpenClaw version: 2026.1.29
  • Channel: webchat
  • Node version: v22.22.0
  • OS: Linux 6.14.0-37-generic (x64)

Test Cases

Tested with multiple commands:

  • Simple loops with sleep
  • Long-running processes
  • All show bulk output, no streaming

Workaround

Background exec + process log pattern:

exec(command, background: true)
process log(sessionId)

This provides real-time output but requires manual work.

Additional Notes

  • Backend analysis confirmed spawn + emitUpdate() is working correctly
  • Framework produces tool_execution_update events
  • These events are not streamed to frontend via WebSocket
  • Only tool_execution_end event is received by frontend
  • This appears to be a frontend/websocket implementation issue, not a backend tool issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleMarked as stale due to inactivity

    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