Files
codex/codex-rs/ext
felixxia-oai 8209978616 Share Guardian user-message retention logic (#42031)
## 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
2026-09-01 10:40:33 +00:00
..
2026-08-25 18:11:04 +00:00