Files
codex/codex-rs
Sean Huang 5078420b01 Preserve output boundaries through token truncation (#57584)
## What changed

Add `OutputBoundary` and token-budget formatting APIs that map item indices and UTF-8 text offsets to their positions after truncation. Normalize input positions, remap boundaries within omitted text, and keep end boundaries before generated omission notices.

Unify code mode output formatting: merge text-only output for truncation with a warning, and budget mixed text and audio in input order while preserving images and encrypted content. Accept owned output items to reuse allocations and move retained media without cloning.

## Testing

Add coverage for boundary normalization and remapping, UTF-8 offsets, zero and nonzero budgets, owned and borrowed output equivalence, and allocation reuse.

GitOrigin-RevId: 598407caa88b5a1f84130c4bc2273b85ab02f7f2
2026-10-27 22:56:23 +00:00
..
…
…
…
…