Skip to content

Stream large engine output over SSE instead of truncating at 2 MB #40

Description

@pavlof01

Context

Engine output is capped at MAX_OUTPUT_BYTES (2 MB) in packages/engine-runtime/src/run.ts; past that the run is flagged meta.outputTruncated and the tail is discarded. Flags like --print-all-code, --trace-ignition and --print-maglev-graphs blow past 2 MB on small snippets, so exactly the most interesting V8 output is the output the user cannot see. The user also waits for the whole run before seeing a single line.

Proposal

  • Stream the engine's stdout/stderr to the gateway and on to the client over SSE (or chunked text/event-stream), with the existing cap raised or removed for streamed responses.
  • Keep the current JSON response as the default so the API contract and the cache are unchanged; streaming is opt-in per request.
  • The output pane appends as chunks arrive, with a hard client-side cap on rendered lines (virtualise or paginate) so the browser survives a 50 MB dump.
  • Do not cache streamed responses; document that.

Acceptance criteria

  • A --print-all-code run shows its first lines before the run completes.
  • A run that exceeds the old cap is fully retrievable.
  • Non-streaming clients see no behaviour change.

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

    backendAPI, sandbox, engine integrationenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions