Priority and scope
P2 — production live-render parity. Follow-up to #600, #643, and #666. Related but separate: #680 owns executable selection; #681 owns retained-history bounds.
Audited commit: b435f7b9179271cbff81d3e40d14ee342cbd65dd.
Evidence level: the buffering behavior is visible in generated-source code; the proposed end-to-end timing regression has not been run by the reviewer. This is not a claim that Workbench has no streaming infrastructure.
Problem
The generated route Flight worker collects renderAgentFlight(...) through:
const renderedBytes = new Uint8Array(await new Response(flight).arrayBuffer());
It sends the completed bytes after collection. The production Workbench consumer already accepts chunk messages, but cannot display the authored Suspense fallback/replacements incrementally when this producer withholds Flight bytes until completion.
A running status or a separate progress notification does not prove that the authored Flight document is being streamed.
Source evidence
- entry-shell.ts:
generatedRouteFlightWorkerSource() buffers the MCP/shared-event Flight response. Existing rendered CLI/script generation provides a chunked-path comparison.
- route-invocation-production.ts:
streamFromWorker() already handles chunk, complete, and end messages through the runtime dispatcher.
Required correction
Forward Flight chunks through the existing worker/dispatcher transport instead of buffering the entire response first. Preserve request context, provider/state lifetime, byte order, error completion, cancellation, and bounded flow control. Apply the correction to generated event execution where it shares this worker, and verify all consumers of the changed transport.
Deterministic acceptance
Test owners
Extend packages/agent-bundle/tests/entry-shell.test.ts, packages/agent-bundle/tests/route-invocation-dev-server.test.ts, and existing Workbench browser acceptance. Assert behavior from actual compiled output, not only source-string shape.
Non-goals
No second renderer, new execution mode, fabricated progress, mocked stream producer as sole proof, or changes to plugin business behavior. Do not satisfy acceptance merely by observing a running status or replaying buffered events after completion.
Priority and scope
P2 — production live-render parity. Follow-up to #600, #643, and #666. Related but separate: #680 owns executable selection; #681 owns retained-history bounds.
Audited commit:
b435f7b9179271cbff81d3e40d14ee342cbd65dd.Evidence level: the buffering behavior is visible in generated-source code; the proposed end-to-end timing regression has not been run by the reviewer. This is not a claim that Workbench has no streaming infrastructure.
Problem
The generated route Flight worker collects
renderAgentFlight(...)through:It sends the completed bytes after collection. The production Workbench consumer already accepts chunk messages, but cannot display the authored Suspense fallback/replacements incrementally when this producer withholds Flight bytes until completion.
A running status or a separate progress notification does not prove that the authored Flight document is being streamed.
Source evidence
generatedRouteFlightWorkerSource()buffers the MCP/shared-event Flight response. Existing rendered CLI/script generation provides a chunked-path comparison.streamFromWorker()already handleschunk,complete, andendmessages through the runtime dispatcher.Required correction
Forward Flight chunks through the existing worker/dispatcher transport instead of buffering the entire response first. Preserve request context, provider/state lifetime, byte order, error completion, cancellation, and bounded flow control. Apply the correction to generated event execution where it shares this worker, and verify all consumers of the changed transport.
Deterministic acceptance
unit-render.Test owners
Extend
packages/agent-bundle/tests/entry-shell.test.ts,packages/agent-bundle/tests/route-invocation-dev-server.test.ts, and existing Workbench browser acceptance. Assert behavior from actual compiled output, not only source-string shape.Non-goals
No second renderer, new execution mode, fabricated progress, mocked stream producer as sole proof, or changes to plugin business behavior. Do not satisfy acceptance merely by observing a
runningstatus or replaying buffered events after completion.