mirror of
https://github.com/openai/codex.git
synced 2026-10-31 19:28:49 +00:00
Reject token-budget history notes for unsupported starting models (#44883)
## What changed After resolving startup configuration and model defaults, reject `features.token_budget.use_history_notes_extension` when the starting model lacks `supports_experimental_context`. Return an error directing users to disable the option or select a compatible model. ## Testing Add startup coverage for explicit configuration and model defaults, verifying rejection for unsupported models and successful activation for supported models and standalone token budgets. Update history-notes test fixtures to declare experimental context support. GitOrigin-RevId: abf1a024efc5acf97cfc858fbb93821363769dc0
This commit is contained in:
@@ -707,6 +707,16 @@ impl Session {
|
||||
&model_info,
|
||||
)?;
|
||||
token_budget::apply_model_defaults(Arc::make_mut(&mut config), &model_info);
|
||||
if config
|
||||
.token_budget
|
||||
.as_ref()
|
||||
.is_some_and(|token_budget| token_budget.use_history_notes_extension)
|
||||
&& !model_info.supports_experimental_context
|
||||
{
|
||||
return Err(CodexErr::InvalidRequest(format!(
|
||||
"features.token_budget.use_history_notes_extension is not supported by model `{model}`; disable it or select a model that supports experimental context"
|
||||
)));
|
||||
}
|
||||
}
|
||||
let configured_config = Arc::clone(&config);
|
||||
let multi_agent_version = config.multi_agent_version_override().or_else(|| {
|
||||
|
||||
Reference in New Issue
Block a user