Files
codex/codex-rs/ansi-escape
Dmitriy Kovalenko ab84d71f57 Omit payloads from multiline ANSI warnings (#49416)
## Why

`ansi_escape_line` logged the rendered contents of every line when given multiline input, allowing large payloads to inflate warning logs.

## What changed

Replace line contents in the warning with structured `input_bytes` and `line_count` fields. Preserve the existing behavior of returning the styled first line.

## Testing

Enable unit tests for `codex-ansi-escape` and add coverage with small and 128 KiB tails, asserting the exact warning fields and preservation of first-line styling.

GitOrigin-RevId: 4be985b4442eaa12f7fdee8a583d6e9714c618d8
2026-09-30 00:51:39 +00:00
..

oai-codex-ansi-escape

Small helper functions that wrap functionality from https://crates.io/crates/ansi-to-tui:

pub fn ansi_escape_line(s: &str) -> Line<'static>
pub fn ansi_escape<'a>(s: &'a str) -> Text<'a>

Advantages:

  • ansi_to_tui::IntoText is not in scope for the entire TUI crate
  • we panic!() and log if IntoText returns an Err and log it so that the caller does not have to deal with it