mirror of
https://github.com/openai/codex.git
synced 2026-11-13 21:30:47 +00:00
Cap persisted command output in paginated history at 64 KiB (#50427)
## Why Paginated history previously persisted completed commands' full `aggregated_output`, allowing large command outputs to inflate stored history. ## What changed - Limit persisted command `aggregated_output` to 64 KiB, including a truncation marker. Preserve the beginning and end of the output without splitting UTF-8 characters. - Apply the shared persistence policy to rollout recording, thread-store appends, and legacy-to-paginated history migration. - Measure persisted payload bytes after truncation so persistence metrics reflect the stored representation. ## Testing Add coverage for the byte limit, UTF-8 boundaries, unchanged inputs that fit, and markers that exceed the budget. Verify capped output in paginated thread history and migrated legacy history, and verify persistence metrics use the truncated payload size. GitOrigin-RevId: 01d420d396ad34b42dc5dc208c0bf88d890639ee
This commit is contained in:
@@ -7,6 +7,7 @@ pub use truncate::approx_bytes_for_tokens;
|
||||
pub use truncate::approx_token_count;
|
||||
pub use truncate::approx_tokens_from_byte_count;
|
||||
pub use truncate::truncate_middle_chars;
|
||||
pub use truncate::truncate_middle_with_marker;
|
||||
pub use truncate::truncate_middle_with_token_budget;
|
||||
|
||||
// Truncate a &str to a byte budget at a char boundary (prefix)
|
||||
|
||||
Reference in New Issue
Block a user