Skip to content

CLI text output waits for the entire response instead of forwarding received bytes #47299

Not planned

Description

@Afloat16

Dify version

CLI at main commit f6c206b.

Reproduction and actual behavior

Text responses are buffered entirely before output, preventing a pipe from receiving early bytes and continuing to read the entire response after its consumer is gone.

Expected behavior and proposed fix

Write raw byte chunks through the IO service with awaited backpressure; async iteration cancels the response on output failure.

Verification

Base 2 failed; complete pnpm test 678 passed, 42 skipped. Actual Response/ReadableStream tests verify output before EOF, lossless split/invalid UTF-8 bytes, and cancellation on write failure. Complete CLI type checking with tsrs --noEmit and formatting with the repository's Oxfmt options passed. The full CLI suite ran under the repository's Vite+ / Vitest tooling (Node 24.22.3; local Bun 1.4.5). Whole-repository backend/web checks and type-aware lint were not run.

Related work

#44271 is PHP SDK workflow/TTS streaming argument forwarding, not CLI text rendering.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions