Apply the unchanged-model compaction shortcut to all session sources (#47934)

Remove the basic-session restriction from the early return in
`maybe_run_previous_model_inline_compact`. When the model is unchanged and
no compaction compatibility hash change is detected, all session sources now
skip rebuilding the previous model's turn context and checking its limits.

GitOrigin-RevId: 75044856609603859b12e6668c7bae488ce0f7f5
This commit is contained in:
Henry Levy
2026-09-24 20:38:26 +00:00
committed by copyberry
parent 694d8d45bd
commit af09e926d6
+1 -4
View File
@@ -1350,10 +1350,7 @@ async fn maybe_run_previous_model_inline_compact(
turn_context.model_info().comp_hash.as_deref(),
);
let previous_model = previous_turn_settings.model;
if crate::guardian::is_basic_session_source(&turn_context.session_source)
&& !should_compact_for_comp_hash_change
&& previous_model == turn_context.model_info().slug
{
if !should_compact_for_comp_hash_change && previous_model == turn_context.model_info().slug {
return Ok(());
}
let previous_model_turn_context = Arc::new(