mirror of
https://github.com/openai/codex.git
synced 2026-02-01 22:47:52 +00:00
Clarify rollback mode flow
This commit is contained in:
@@ -3193,7 +3193,7 @@ mod handlers {
|
||||
&& let Some(collaboration_mode) = state
|
||||
.turn_context_history
|
||||
.last()
|
||||
.and_then(|turn_context| turn_context.as_ref())
|
||||
.and_then(Option::as_ref)
|
||||
.and_then(|turn_context| turn_context.collaboration_mode.clone())
|
||||
{
|
||||
state.session_configuration.collaboration_mode = collaboration_mode;
|
||||
|
||||
@@ -207,6 +207,8 @@ impl App {
|
||||
return;
|
||||
}
|
||||
|
||||
// Optimistically apply the target mode for the rollback preview, but remember the
|
||||
// prior mode so we can restore it if core rejects the rollback.
|
||||
let previous_collaboration_mask = self
|
||||
.chat_widget
|
||||
.replace_collaboration_mask(selection.collaboration_mode.clone());
|
||||
@@ -472,6 +474,7 @@ impl App {
|
||||
if pending.thread_id != self.chat_widget.thread_id() {
|
||||
return;
|
||||
}
|
||||
// Rollback failed: revert the optimistic mode switch to the pre-rollback mask.
|
||||
self.chat_widget
|
||||
.replace_collaboration_mask(pending.previous_collaboration_mask);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user