Files
codex/codex-rs
Charlie Marsh c265acf3b1 Reduce n-gram allocations in dynamic skill selection (#63834)
## Why

Skill selection allocated strings for candidate n-grams that never
contribute to scoring because they are absent from the query.

## What changed

Deduplicate n-grams as borrowed UTF-8 slices and retain owned strings
for candidate n-grams only when they match the query. Count all
distinct n-grams toward the existing limit so filtering preserves
which n-grams are eligible for scoring.

## Testing

Add a regression test that verifies unmatched ASCII n-grams consume
the limit and that the first matching Japanese n-gram is retained.

GitOrigin-RevId: 05ec72b4f66b8a0befb5e86a077b1c9fbaac704d
2026-11-25 05:49:37 +00:00
..
…
…
…