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.
Context
Engine output is capped at
MAX_OUTPUT_BYTES(2 MB) inpackages/engine-runtime/src/run.ts; past that the run is flaggedmeta.outputTruncatedand the tail is discarded. Flags like--print-all-code,--trace-ignitionand--print-maglev-graphsblow 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
text/event-stream), with the existing cap raised or removed for streamed responses.Acceptance criteria
--print-all-coderun shows its first lines before the run completes.