mirror of
https://github.com/openai/codex.git
synced 2026-11-03 16:23:51 +00:00
Keep the TUI open when starting a turn fails (#34636)
## What changed - Handle app-server `turn/start` rejections for pending user turns as turn errors instead of exiting the TUI. - Finalize the pending turn, display the failure in the transcript, and resume queued input handling. - Add coverage that submits a turn to a missing thread and verifies that the error is shown while the app continues running. GitOrigin-RevId: 6d291ba62b9e50d49dd4e3d7c429e98c1f754680
This commit is contained in:
1 parent
1b77da35cc
commit
0a39ff138e
5 files changed
+92
-4
No files matched your search
@@ -366,7 +366,7 @@ impl ChatWidget {
|
||||
self.maybe_send_next_queued_input();
|
||||
}
|
||||
|
||||
pub(super) fn on_error(&mut self, message: String) {
|
||||
fn on_error(&mut self, message: String) {
|
||||
self.input_queue.submit_pending_steers_after_interrupt = false;
|
||||
self.flush_answer_stream_with_separator();
|
||||
self.finalize_turn();
|
||||
@@ -381,6 +381,14 @@ impl ChatWidget {
|
||||
self.maybe_send_next_queued_input();
|
||||
}
|
||||
|
||||
pub(crate) fn handle_turn_start_rejection(&mut self, message: String) -> bool {
|
||||
if !self.input_queue.user_turn_pending_start {
|
||||
return false;
|
||||
}
|
||||
self.on_error(message);
|
||||
true
|
||||
}
|
||||
|
||||
pub(super) fn on_cyber_policy_error(&mut self) {
|
||||
self.input_queue.submit_pending_steers_after_interrupt = false;
|
||||
self.finalize_turn();
|
||||
|
||||
Reference in new issue
Block a user