Michael Bolin and GitHub
77e7ce1374
fix: scope context remaining to body window ( #29665 )
...
## Why
With `model_auto_compact_token_limit_scope = "body_after_prefix"`, the
persistent prefix should not count against the active body window.
`get_context_remaining` and the token-budget reminder should report the
same usable body-after-prefix window that auto-compaction uses, rather
than the total token count since the session began.
This is stacked on #29664 so the mechanical move from `turn.rs` is
isolated from the behavior fix.
## What
- Extends `ContextWindowTokenStatus` with `context_remaining_tokens`.
- Updates `get_context_remaining` to use the shared context-window
accounting.
- Adds integration coverage for body-after-prefix reminder timing and
`get_context_remaining` output.
## Testing
- `just test -p codex-core body_after_prefix_window`
- `just test -p codex-core auto_compact_body_after_prefix`
- `just fix -p codex-core`
2026-06-23 23:08:54 +00:00
..
2026-06-22 23:37:49 +00:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-23 14:15:20 +02:00
2026-06-15 21:53:47 -07:00
2026-06-22 23:56:16 -07:00
2026-06-23 21:45:06 +00:00
2026-06-23 21:45:06 +00:00
2026-06-23 12:13:54 -07:00
2026-06-15 21:53:47 -07:00
2026-06-15 21:53:47 -07:00
2026-06-22 16:45:14 -07:00
2026-06-22 16:45:14 -07:00
2026-06-23 23:08:54 +00:00
2026-05-14 16:15:56 -07:00
2026-06-08 13:55:15 -07:00
2026-06-22 16:45:14 -07:00
2026-06-22 11:11:25 -07:00
2026-06-18 11:54:49 -07:00
2026-06-22 11:11:25 -07:00
2026-06-23 10:13:27 -07:00
2026-06-19 05:35:57 -07:00
2026-06-15 21:53:47 -07:00
2026-06-18 14:09:38 +02:00
2026-06-22 10:05:11 -07:00
2026-06-23 10:23:25 -04:00
2026-06-22 11:54:44 -07:00
2026-06-15 21:53:47 -07:00
2026-06-23 14:27:13 -07:00
2026-06-22 16:45:14 -07:00
2026-06-17 06:03:00 +00:00
2026-06-08 13:55:15 -07:00
2026-06-15 21:53:47 -07:00
2026-06-23 18:29:27 +01:00
2026-06-22 16:45:23 -07:00
2026-06-17 08:50:39 -07:00
2026-06-23 18:29:27 +01:00
2026-05-18 21:03:51 -07:00
2026-06-23 14:15:20 +02:00
2026-06-22 10:05:11 -07:00
2026-06-15 21:53:47 -07:00
2026-06-10 20:42:55 -07:00
2026-06-08 13:55:15 -07:00
2026-06-22 10:05:36 +02:00
2026-06-23 14:27:13 -07:00
2026-06-23 21:45:06 +00:00
2026-06-22 20:44:48 -07:00
2026-06-08 13:55:15 -07:00
2026-06-23 14:15:20 +02:00
2026-06-08 13:55:15 -07:00
2026-06-23 21:50:50 +00:00
2026-06-10 20:42:55 -07:00
2026-06-22 16:45:23 -07:00
2026-06-22 16:45:14 -07:00
2026-06-22 16:45:14 -07:00
2026-06-08 13:55:15 -07:00
2026-06-22 11:11:25 -07:00
2026-06-23 21:45:06 +00:00
2026-06-15 21:53:47 -07:00
2026-06-08 13:55:15 -07:00
2026-06-15 21:53:47 -07:00
2026-06-16 20:45:57 +00:00
2026-06-18 20:08:04 -04:00
2026-06-15 21:53:47 -07:00
2026-06-08 13:55:15 -07:00
2026-06-22 23:56:16 -07:00
2026-06-23 10:23:25 -04:00
2026-06-08 13:55:15 -07:00
2026-06-22 11:11:25 -07:00
2026-06-23 21:45:06 +00:00
2026-06-23 15:01:28 -07:00
2026-06-22 09:36:08 +02:00
2026-06-22 19:51:03 -07:00
2026-06-08 13:55:15 -07:00
2026-06-22 16:45:23 -07:00
2026-06-23 14:27:13 -07:00
2026-06-23 14:27:13 -07:00
2026-06-15 21:53:47 -07:00
2026-06-08 13:55:15 -07:00
2026-06-23 21:45:06 +00:00
2026-06-15 21:53:47 -07:00
2026-06-23 21:50:50 +00:00
2026-06-08 13:55:15 -07:00
2026-06-08 13:55:15 -07:00
2026-06-23 14:15:20 +02:00
2026-06-23 23:08:54 +00:00
2026-06-15 21:53:47 -07:00
2026-06-15 21:53:47 -07:00
2026-06-15 21:53:47 -07:00
2026-06-22 10:05:11 -07:00
2026-06-15 21:53:47 -07:00
2026-06-08 13:55:15 -07:00
2026-06-23 21:45:06 +00:00
2026-06-18 16:13:07 -07:00
2026-06-08 13:55:15 -07:00
2026-06-16 10:37:06 -07:00
2026-06-23 21:45:06 +00:00
2026-06-19 05:35:57 -07:00
2026-06-08 13:55:15 -07:00
2026-06-15 21:53:47 -07:00
2026-06-18 14:09:38 +02:00