mirror of
https://github.com/openai/codex.git
synced 2026-09-07 15:40:00 +00:00
Honor turn token budgets in Guardian review rollover (#41221)
## What changed Resolve the review model's token budget from the parent turn's original configuration and model-default setting when deciding whether a Guardian follow-up review needs context rollover. This preserves explicit token-budget preferences instead of unconditionally applying the review model's defaults. GitOrigin-RevId: cb3adaea7dad22f4975d84c6ee62dfc2bfbddbb9
This commit is contained in:
@@ -956,6 +956,7 @@ async fn run_review_on_session(
|
||||
&& crate::session::context_window::context_window_token_status_for_model(
|
||||
review_session.session.as_ref(),
|
||||
¶ms.spawn_config,
|
||||
params.parent_context.turn(),
|
||||
&model_info,
|
||||
)
|
||||
.await
|
||||
|
||||
@@ -37,10 +37,15 @@ pub(crate) async fn context_window_token_status(
|
||||
pub(crate) async fn context_window_token_status_for_model(
|
||||
sess: &Session,
|
||||
config: &Config,
|
||||
turn_context: &TurnContext,
|
||||
model_info: &ModelInfo,
|
||||
) -> ContextWindowTokenStatus {
|
||||
let mut config = config.clone();
|
||||
super::token_budget::apply_model_defaults(&mut config, model_info);
|
||||
config.token_budget = super::token_budget::resolve_token_budget(
|
||||
turn_context.configured_token_budget.as_ref(),
|
||||
turn_context.use_model_token_budget_defaults,
|
||||
model_info,
|
||||
);
|
||||
context_window_token_status_with_config(sess, &config, model_info).await
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user