Make token budget context identity configurable (#36970)

## What changed

- Add a `features.token_budget.mode` setting with `thread` and `name` values.
- Default context-window metadata to the thread ID while allowing configurations to retain the agent name.
- Preserve the selected identity mode when applying model token-budget defaults and replaying locked configuration.

## Testing

- Cover configuration parsing and both identity formats in token-budget context messages.

GitOrigin-RevId: f6e6d2c49e09e70c0352e803bb65784ef77e5bee
This commit is contained in:
Boyang Niu authored and copyberry committed 2026-08-04 20:48:40 +00:00
1 parent 720c9d68e1
commit c607da9f37
11 files changed
+102 -12

No files matched your search

+6
View File
@@ -3502,6 +3502,12 @@ impl Session {
session_source
.get_agent_path()
.unwrap_or_else(codex_protocol::AgentPath::root),
turn_context
.config
.token_budget
.as_ref()
.map(|config| config.mode)
.unwrap_or_default(),
auto_compact_window_ids.first_window_id,
auto_compact_window_ids.previous_window_id,
auto_compact_window_ids.window_id,