Files
codex/codex-rs/ext
jif 911012490c Return Luna samples when streamed JSON completes (#38383)
## Why

Structured output can be complete before the Responses stream emits its terminal
events. Waiting for those events unnecessarily delays the sampler and can leave it
waiting after usable output has arrived.

## What changed

- Return a Luna sample as soon as accumulated text deltas parse as a complete JSON
  object.
- Continue draining the remaining response events in the background so the
  authenticated WebSocket stays reusable for subsequent samples.
- Enforce the output-size limit while accumulating deltas on the early-return path.

## Testing

- Cover returning complete JSON without terminal response events.
- Verify that early return still allows the authenticated WebSocket to be reused.

GitOrigin-RevId: 80c9963f1540f7862356aaad3503e3071a8fb92a
2026-08-13 14:20:38 +00:00
..