Reinject canonical context for model-switch pre-turn compaction

This commit is contained in:
Charles Cunningham
2026-02-17 17:10:48 -08:00
parent 5a5acddcc1
commit afe5c01d3b
2 changed files with 14 additions and 1 deletions
+5 -1
View File
@@ -4675,7 +4675,11 @@ async fn maybe_run_previous_model_inline_compact(
sess,
&previous_turn_context,
AutoCompactCallsite::PreTurnExcludingIncomingUserMessage,
TurnContextReinjection::Skip,
// Even though incoming turn items are excluded here, this pass can be the only
// compaction run before submission. Reinject canonical context so unchanged
// model-visible instructions remain present if no follow-up pre-turn compaction
// is needed.
TurnContextReinjection::ReinjectAboveLastRealUser,
None,
)
.await?;