READ BYTES · FRAME EVENTS · CONSUME
Generated-text streaming: preserve bytes and event identity
Fragment real encoded bytes, inspect the parser buffer and follow complete events into an ordered text consumer.
Text source and visible output
Appended output
Unparsed buffer: first 32 bytes in hex
Your experiment
Inject a duplicate event, then disable duplicate handling. Observe repeated text despite valid framing. This uses local synthetic text, not Gemini requests or provider response formats.
The text is split into six-code-point deltas, numbered from 1. A source fault targets event 3, or the last event when fewer than three exist. Output is appended only after a complete frame is parsed and consumer processing finishes.
In streaming mode a full application queue pauses reads; one additional event may be processing. In buffered mode all body bytes arrive before parsing begins. The same 60-second inspection maps proportionally to each scenario’s modeled duration; it is not a network performance measurement.
Recent parser and consumer events
Original event fixtures
Offline byte-framing lesson. SSE parsing supports only the generated LF-delimited id/data subset; this is not a complete EventSource implementation. The alternative uses a zero compression byte plus four-byte big-endian payload length and UTF-8 JSON, not Protobuf. No HTTP/2 frames, headers, trailers, grpc-status, compression, TLS, provider API, A2A envelope, retries or reconnect/resume are implemented. The queue policy is application backpressure, not transport flow control. Duplicate suppression and strict contiguous event IDs are explicit application policies, not guarantees supplied by SSE/gRPC. Missing IDs are rejected without reordering or replay. Empty source is complete with no output; an incomplete frame remains truncated. SSE specification · gRPC message framing.
Validate the visible text as well as the frame
Correct framing is necessary but not sufficient for a generated-text consumer. A duplicate event can be valid JSON in a valid frame and still append the same text twice. This experiment uses fictional local deltas with explicit sequence identifiers, then checks the application policy that decides which deltas may be appended. The provider name in the historical URL does not mean a Gemini request is made or that this custom schema matches a provider response. No API key, account or customer prompt is used.
Control the byte and application boundaries
Local text supplies the payload, with the browser limiting entry to one hundred twenty UTF-16 code units. The model groups Unicode code points into records of up to six, each with a sequence identifier and delta string. Framing format selects the LF-delimited SSE subset or an uncompressed five-byte gRPC-style prefix around JSON. Application consumption either parses complete events incrementally or waits for the full body. Bytes per read changes fragmentation, Read interval changes scheduled arrival spacing, Processing per event changes consumer time, and Queued events bounds waiting records separately from the one active record. Parameter edits rebuild the scenario and start inspection unless reduced motion is requested.
Reproduce valid frames with an incorrect final answer
Select Repeat one event ID while keeping Ignore already-applied event IDs enabled. The repeated frame is decoded, but the consumer suppresses its second application and the final output equals the original text. Disable the checkbox: the same valid event now appends its delta twice and the preview reports duplicate output. The fault targets event three, or the last available event for a shorter source. Use the original event fixture to identify the repeated delta instead of relying only on the visual output length. Duplicate handling is an explicit application policy, not a property guaranteed by the framing format.
Inject failures and inspect safely
Source event fault repeats, omits or corrupts the third event, or the last available event for a shorter source; truncation removes the final three wire bytes. Ignore already-applied event IDs affects duplicate records only. Missing or malformed records can leave a sequence gap, and later records are rejected rather than reordered or replayed. Play and Pause inspect sixty seconds of viewing time; Next event advances a recorded scheduler transition; Restart inspection rewinds; Speed adjusts viewing pace; Inspection time scrubs. Visible output, pending-byte hex and recent events reflect the inspected prefix. The complete-run preview and original event list describe the full scenario, not work already consumed.
Distinguish a gap, malformed input and incomplete bytes
Choose Omit one event ID. The consumer expects a contiguous sequence and rejects later events when the missing identifier leaves a gap; it neither invents the missing text nor requests a replay. Malformed JSON rejects a complete frame and can cause the same downstream sequence gap. Truncating the final three bytes instead leaves an incomplete frame buffered at the end. These failures have different evidence even when each produces partial text. Enter an empty source to confirm a complete stream with no appends, and enter literal markup to confirm that output is shown as text. This lab excludes reconnect/resume, persistence, tool calls, multimodal payloads, safety decisions and provider finish reasons, which require separate integration tests.