Persist pre-turn updates before interrupted model-switch compact exits

This commit is contained in:
Charles Cunningham
2026-02-17 17:15:51 -08:00
parent ace4aa5fc0
commit 8fe0e8b903
+3 -1
View File
@@ -4689,7 +4689,6 @@ async fn maybe_run_previous_model_inline_compact(
.await
{
Ok(()) => Ok(()),
Err(CodexErr::Interrupted) => Err(()),
Err(err) => {
if !pre_turn_context_items.is_empty() {
// Preserve model-visible settings updates even when pre-turn compaction fails
@@ -4697,6 +4696,9 @@ async fn maybe_run_previous_model_inline_compact(
sess.record_conversation_items(turn_context, pre_turn_context_items)
.await;
}
if matches!(err, CodexErr::Interrupted) {
return Err(());
}
let compact_error_prefix = if should_use_remote_compact_task(&turn_context.provider) {
"Error running remote compact task"
} else {