feat: message when stream get correctly resumed (#4988)

<img width="366" height="109" alt="Screenshot 2025-10-09 at 17 44 16"
src="https://github.com/user-attachments/assets/26bc6f60-11bc-4fc6-a1cc-430ca1203969"
/>
This commit is contained in:
jif-oai
2025-10-10 10:07:14 +01:00
committed by GitHub
parent ddcaf3dccd
commit f98fa85b44
7 changed files with 49 additions and 22 deletions

View File

@@ -276,6 +276,8 @@ fn make_chatwidget_manual() -> (
interrupts: InterruptManager::new(),
reasoning_buffer: String::new(),
full_reasoning_buffer: String::new(),
current_status_header: String::from("Working"),
retry_status_header: None,
conversation_id: None,
frame_requester: FrameRequester::test_dummy(),
show_welcome_banner: true,
@@ -2044,9 +2046,10 @@ fn plan_update_renders_history_cell() {
}
#[test]
fn stream_error_is_rendered_to_history() {
fn stream_error_updates_status_indicator() {
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual();
let msg = "stream error: stream disconnected before completion: idle timeout waiting for SSE; retrying 1/5 in 211ms…";
chat.bottom_pane.set_task_running(true);
let msg = "Re-connecting... 2/5";
chat.handle_codex_event(Event {
id: "sub-1".into(),
msg: EventMsg::StreamError(StreamErrorEvent {
@@ -2055,11 +2058,15 @@ fn stream_error_is_rendered_to_history() {
});
let cells = drain_insert_history(&mut rx);
assert!(!cells.is_empty(), "expected a history cell for StreamError");
let blob = lines_to_single_string(cells.last().unwrap());
assert!(blob.contains('⚠'));
assert!(blob.contains("stream error:"));
assert!(blob.contains("idle timeout waiting for SSE"));
assert!(
cells.is_empty(),
"expected no history cell for StreamError event"
);
let status = chat
.bottom_pane
.status_widget()
.expect("status indicator should be visible");
assert_eq!(status.header(), msg);
}
#[test]