mirror of
https://github.com/openai/codex.git
synced 2026-11-13 06:45:07 +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:
1 parent
e325e3acd9
commit
2d929eb7c3
2 files changed
+7
-1
No files matched your search
@@ -956,6 +956,7 @@ async fn run_review_on_session(
|
|||||||
&& crate::session::context_window::context_window_token_status_for_model(
|
&& crate::session::context_window::context_window_token_status_for_model(
|
||||||
review_session.session.as_ref(),
|
review_session.session.as_ref(),
|
||||||
¶ms.spawn_config,
|
¶ms.spawn_config,
|
||||||
|
params.parent_context.turn(),
|
||||||
&model_info,
|
&model_info,
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
|
|||||||
@@ -37,10 +37,15 @@ pub(crate) async fn context_window_token_status(
|
|||||||
pub(crate) async fn context_window_token_status_for_model(
|
pub(crate) async fn context_window_token_status_for_model(
|
||||||
sess: &Session,
|
sess: &Session,
|
||||||
config: &Config,
|
config: &Config,
|
||||||
|
turn_context: &TurnContext,
|
||||||
model_info: &ModelInfo,
|
model_info: &ModelInfo,
|
||||||
) -> ContextWindowTokenStatus {
|
) -> ContextWindowTokenStatus {
|
||||||
let mut config = config.clone();
|
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
|
context_window_token_status_with_config(sess, &config, model_info).await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user