mirror of
https://github.com/openai/codex.git
synced 2026-05-28 15:00:16 +00:00
Persist pre-turn updates before interrupted model-switch compact exits
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user