Files
codex/codex-rs/ext
jif 76d282ae2e Use reported token usage for Guardian v2 soft resets (#65244)
## Why

Conservative image token estimates can trigger a soft reset even when the
completed scoring conversation leaves room for new evidence.

## What changed

Store the reported context token count with each completed scoring conversation.
For the next soft reset decision, add the estimated tokens for new evidence to
that count. Fall back to estimating the retained history when the latest
completion has no usable usage. The hard input limit and metrics still use the
conservative full-request estimate.

## Testing

Cover history reuse after a low usage report, rebuilding after a higher report,
and fallback when usage is zero or missing. Check that a low reported count
cannot bypass the hard input limit.

GitOrigin-RevId: 42557d5b7272e651046e7c06226f757b59b9fa67
2026-12-02 12:22:39 +00:00
..