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

This commit is contained in:
Charles Cunningham
2026-02-16 22:49:56 -08:00
parent d81d89ac0b
commit f7956ffabc

View File

@@ -4695,7 +4695,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
@@ -4703,6 +4702,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 {