pakrym-oai and GitHub
658af936fd
[codex] Add token budget context feature ( #27438 )
...
## Why
The model should be able to see bounded context-window budget metadata
when the `token_budget` feature is enabled. The full-window message is
only injected with full context, while normal turns get a smaller
follow-up only when reported usage first crosses a budget threshold.
## What changed
- Added the `TokenBudget` feature flag.
- Added `<token_budget>` developer fragments for full context-window
metadata and current-window remaining tokens.
- Inserted the threshold message during normal turn handling by
comparing token usage before and after sampling, avoiding persistent
threshold bookkeeping.
- Added core integration coverage for full-context-only metadata and
25/50/75 percent threshold messages.
## Verification
- `just test -p codex-core token_budget`
- `git diff --check`
2026-06-10 20:07:06 -07:00
..
2026-06-09 15:20:01 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 14:21:28 +02:00
2026-03-27 19:00:44 -07:00
2026-05-27 11:09:33 -07:00
2026-06-09 20:51:57 +00:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-10 12:19:26 -07:00
2026-06-10 08:47:16 -07:00
2026-06-10 08:47:16 -07:00
2026-06-10 19:21:24 -07:00
2026-05-14 16:15:56 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-09 17:54:32 -07:00
2026-06-08 13:55:15 -07:00
2026-06-09 20:51:57 +00:00
2026-05-14 18:04:26 -07:00
2026-06-08 13:55:15 -07:00
2026-05-28 15:26:55 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-05-14 12:40:01 -07:00
2026-05-29 10:22:27 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-05-22 16:58:14 +00:00
2026-06-08 13:55:15 -07:00
2026-06-10 20:07:06 -07:00
2026-05-18 21:03:51 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-05-15 01:26:50 +00:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-02 12:10:14 +02:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-04 12:43:07 -07:00
2026-06-08 13:55:15 -07:00
2026-06-09 17:54:32 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-05-19 14:45:37 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-06 01:01:20 +00:00
2026-06-04 13:36:24 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-10 19:21:24 -07:00
2026-06-01 04:33:20 +00:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-05-14 16:15:56 -07:00
2026-05-18 09:57:54 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-04 18:49:51 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-09 19:51:54 +02:00
2026-06-10 20:07:06 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-03-11 12:33:09 -07:00
2026-06-08 13:55:15 -07:00
2026-06-09 15:10:17 -07:00
2026-06-01 23:33:42 +00:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-10 19:21:24 -07:00
2026-04-28 23:01:40 +00:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-03 15:33:34 -07:00