Bound rollout trace capture with configurable storage limits (#61896)

## What changed

- Add `rollout_trace.max_payload_bytes` and `rollout_trace.max_bytes`, defaulting to 64 MiB per body or separated value and 256 MiB per bundle. Root and child threads share the bundle budget.
- Record explicit truncations and omissions when limits are reached, reserve space for later events, and stop at the last complete event if the event log fills.
- Reuse identical prepared-prompt items and store inline images separately from message structure. Preserve exact JSON bytes for complete composite payloads and surviving content and links in partial captures.
- Let reducers handle partial payloads while retaining lifecycle information and reporting `closed_with_partial_payloads` for closed bundles with incomplete captures.

## Testing

Add coverage for payload reuse and byte-exact reconstruction, truncation, compressed bundle budgets, later events after omissions, readable prefixes after event-space exhaustion, and CLI capture-limit configuration and startup failures.

GitOrigin-RevId: be99a68da427414a7a12bf8209f232c1a0bbe545
This commit is contained in:
cassirer-openai
2026-11-16 22:26:31 +00:00
committed by copyberry
parent c0d47262f3
commit ef6ce8100a
23 changed files with 712 additions and 107 deletions
@@ -356,6 +356,7 @@ async fn new_config(
log_dir: codex_home.join("log").to_path_buf(),
codex_home,
history: History::default(),
rollout_trace_limits: Default::default(),
ephemeral: true,
allow_persistent_dynamic_tool_updates: false,
extra_config: None,