mirror of
https://github.com/openai/codex.git
synced 2026-10-18 17:18:52 +00:00
## What changed - Replace the single byte limit with token-derived per-entry and separate message and tool transcript budgets. - Preserve the first and latest user messages, then fill the remaining budgets with recent user, assistant, and tool context while limiting retained non-user entries. - Truncate oversized entries in the middle without splitting UTF-8 characters, and report the approximate omitted token count. - Exclude reasoning from the default transcript sources while retaining support when it is explicitly configured. ## Testing - Cover oversized message and tool-result truncation, user-message retention, separate tool budgeting, configured reasoning, and the resulting Guardian sampling request. GitOrigin-RevId: aaeaa5fb5d902b5a1581a8a819bf34724bde794b