Skip to content

feat(#3996): stream model-generated media deltas - #4023

Draft
aheritier wants to merge 1 commit into
gemini-gateway-transportfrom
generated-media-streaming
Draft

feat(#3996): stream model-generated media deltas#4023
aheritier wants to merge 1 commit into
gemini-gateway-transportfrom
generated-media-streaming

Conversation

@aheritier

@aheritier aheritier commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

What

Streams model-generated media deltas through Gemini adaptation, runtime streaming, chat media types, and tests.

Why

Generated media should become available incrementally rather than waiting for the entire response.

Validation

task test; Gemini adapter and runtime streaming tests.

Test instructions

Run:

task test

Invoke a media-generating model and observe the chat stream. Expected: generated-media deltas arrive in order as they are received, are represented by the chat stream, and do not require waiting for the complete response.

@aheritier aheritier added area/providers/gemini Google Gemini provider support area/runtime Runtime engine, agent loop execution, tool dispatch, loop detection kind/feat PR adds a new feature (maps to feat:). Use on PRs only. labels Aug 22, 2026
@aheritier
aheritier force-pushed the generated-media-streaming branch from fc76f6a to 79f0624 Compare August 24, 2026 15:13
@aheritier
aheritier force-pushed the generated-media-streaming branch from 79f0624 to 99aa451 Compare August 25, 2026 07:59
@aheritier
aheritier force-pushed the generated-media-streaming branch from 99aa451 to 1d9a86b Compare August 25, 2026 20:24
@aheritier
aheritier force-pushed the generated-media-streaming branch from 1d9a86b to 1d2122c Compare August 26, 2026 11:08
@aheritier
aheritier force-pushed the generated-media-streaming branch 2 times, most recently from 199777b to 1d2122c Compare September 1, 2026 16:14
@aheritier
aheritier force-pushed the generated-media-streaming branch from 1d2122c to b78c6e1 Compare September 1, 2026 16:29
aheritier

This comment was marked as resolved.

@aheritier
aheritier force-pushed the generated-media-streaming branch from b78c6e1 to 86bc00a Compare September 6, 2026 16:14
@aheritier
aheritier force-pushed the generated-media-streaming branch from 86bc00a to 1fbe55a Compare September 7, 2026 11:19
@aheritier
aheritier force-pushed the generated-media-streaming branch from 1fbe55a to 8a3aac5 Compare September 7, 2026 11:34
@aheritier
aheritier force-pushed the generated-media-streaming branch from 8a3aac5 to ec5939e Compare September 7, 2026 16:25
@aheritier
aheritier force-pushed the generated-media-streaming branch from ec5939e to 2908d6a Compare September 7, 2026 16:47
@aheritier
aheritier force-pushed the generated-media-streaming branch from 2908d6a to 35584ec Compare September 8, 2026 06:17
@aheritier
aheritier force-pushed the generated-media-streaming branch from 35584ec to 11f14e7 Compare September 8, 2026 07:57
Extend the shared chat.MessageDelta streaming representation with typed
MediaDelta entries (bytes + MIME + name + size) so generated binary media
has a provider-agnostic path instead of a Gemini-only side channel. The
Gemini adapter captures inline image blobs from response candidates the
same way it already captures text/reasoning/tool calls/usage — retaining
every blob in a chunk, not just the last — and the run() content gate
forwards image-only chunks that previously would have been dropped.

The runtime's stream accumulator (pkg/runtime/streaming.go) collects the
deltas into streamResult.Media, accumulating before any terminal check so
a final chunk that carries both media and a finish reason is never lost.
Persistence of the accumulated media ships in the follow-up
materialization commits.
@aheritier
aheritier force-pushed the generated-media-streaming branch from 11f14e7 to 86a7827 Compare September 8, 2026 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

) area/providers/gemini Google Gemini provider support area/runtime Runtime engine, agent loop execution, tool dispatch, loop detection kind/feat PR adds a new feature (maps to feat:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant