mirror of
https://github.com/openai/codex.git
synced 2026-10-19 16:17:49 +00:00
## 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
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::IntoTextis not in scope for the entire TUI crate- we
panic!()and log ifIntoTextreturns anErrand log it so that the caller does not have to deal with it