return to prompt

This commit is contained in:
easong-openai
2025-08-04 21:59:41 -07:00
parent 36a65b445f
commit 6d57d838bd
2 changed files with 9 additions and 1 deletions

View File

@@ -628,7 +628,7 @@ impl AgentTask {
let event = Event {
id: self.sub_id,
msg: EventMsg::BackgroundEvent(BackgroundEventEvent {
message: "Turn interrupted — returning to the prompt.".to_string(),
message: "Response interrupted.".to_string(),
}),
};
let tx_event = self.sess.tx_event.clone();

View File

@@ -10,6 +10,7 @@ use codex_core::protocol::AgentMessageEvent;
use codex_core::protocol::AgentReasoningDeltaEvent;
use codex_core::protocol::AgentReasoningEvent;
use codex_core::protocol::ApplyPatchApprovalRequestEvent;
use codex_core::protocol::BackgroundEventEvent;
use codex_core::protocol::ErrorEvent;
use codex_core::protocol::Event;
use codex_core::protocol::EventMsg;
@@ -220,6 +221,13 @@ impl ChatWidget<'_> {
pub(crate) fn handle_codex_event(&mut self, event: Event) {
let Event { id, msg } = event;
match msg {
EventMsg::BackgroundEvent(BackgroundEventEvent { message }) => {
self.add_to_history(HistoryCell::new_background_event(message.clone()));
if message.contains("Turn interrupted") {
self.bottom_pane.set_task_running(false);
}
self.request_redraw();
}
EventMsg::SessionConfigured(event) => {
self.bottom_pane
.set_history_metadata(event.history_log_id, event.history_entry_count);