mirror of
https://github.com/openai/codex.git
synced 2026-09-03 14:59:03 +00:00
## What changed - Add a shared `select_user_messages` helper in `guardian-context` that always anchors the first user message and fills the remaining token budget from newest to oldest. - Use the helper for both core Guardian prompt rendering and the Guardian V2 async scorer so they apply the same retention policy. ## Testing - Cover empty and single-message transcripts, over-budget anchors, and newest-first selection across multiple token budgets. GitOrigin-RevId: 7db246013875263ceb5806d2a6a19b4e2a3db1c4