mirror of
https://github.com/openai/codex.git
synced 2026-11-07 20:30:33 +00:00
Support model-owned token budget defaults (#35608)
## What changed - Add token-budget settings to model catalog messages and apply them when the feature is enabled without explicit token-budget configuration. - Keep explicit user settings authoritative, reject invalid catalog defaults, and preserve resolved defaults in exported config locks. - Manage context-window guidance through world state so it updates once when the active model changes while retaining prior conversation history. ## Testing - Cover catalog defaults, explicit overrides, disabled features, invalid values, config-lock replay, and model switching. GitOrigin-RevId: 54544fefaa14b09f5ef5bad9967a13c52b87b0fe
This commit is contained in:
@@ -115,6 +115,7 @@ fn clear_instruction_messages(model: &mut ModelInfo) {
|
||||
if model_messages.approvals.is_none()
|
||||
&& model_messages.auto_review.is_none()
|
||||
&& model_messages.permissions.is_none()
|
||||
&& model_messages.token_budget.is_none()
|
||||
{
|
||||
model.model_messages = None;
|
||||
}
|
||||
@@ -181,6 +182,7 @@ fn local_personality_messages_for_slug(slug: &str) -> Option<ModelMessages> {
|
||||
approvals: None,
|
||||
auto_review: None,
|
||||
permissions: None,
|
||||
token_budget: None,
|
||||
}),
|
||||
_ => None,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user