antigravity harness server - support streaming
- Dominant language
- Go
- Stars
- 2k
- Forks
- 120
- PR merge metrics
- No merged PRs in 30d
Description
## Problem statement
Antigravity harness currently has slow TTFT for `Text` / `Thought` output.
The harness currently buffers contiguous text/thought chunks and only emits after the block completes. This makes the content boundary clear for downstream display code, but it also means AX cannot render the first token until the whole buffered block is done.
Desired behavior:
- emit the first visible output as soon as the model stream produces it
- preserve the difference between answer text and thought-summary text
- keep final/durable content semantics correct
- avoid a broad protocol redesign
## Proposal
Add explicit streaming delta content types:
- `TextDeltaContent`
- `ThoughtSummaryDeltaContent`
These are modeled after the streaming primitives `TextDelta` and `ThoughtSummaryDelta` in [`google-genai`](https://github.com/googleapis/python-genai).
## Streaming semantics
The harness **should not** infer sentence boundaries.
Instead, deltas are ordered append-only chunks for the current contiguous output run. A delta run is complete when:
- the next delta has a different content kind
- the role changes
- a non-delta output arrives, such as tool call/tool result
- the stream ends
Responsibilities:
- Harness server emits deltas immediately and preserves order.
- Controller accumulates adjacent deltas with the same role/kind for durable logs/history.
- Display renders deltas immediately and switches formatting when role/kind changes.
## Implementation tasks
1. **Proto**
- Add `TextDeltaContent` and `ThoughtSummaryDeltaContent`, modeled after Antigravity SDK primitives.
- Add `text_delta` and `thought_summary_delta` to `Content`.
2. **Antigravity harness**
- Emit `text_delta` / `thought_summary_delta` as chunks arrive.
- Stop waiting for the full contiguous text/thought block before yielding.
3. **Controller**
- Accept delta content in stream handling.
- Accumulate adjacent deltas into durable text/thought output where needed.
- Flush accumulation on role change, kind change, non-delta output, or stream end.
4. **Display / clients**
- Render `text_delta` as streamed assistant text.
- Render `thought_summary_delta` as streamed thought-summary text.
- Add handling for the new delta types wherever content variants are switched on.
**- Note Display / clients side are reasonable for formatting**
Contributor guide
Assessment
This issue has not been assessed yet.