mirror of
https://github.com/openai/codex.git
synced 2026-11-18 23:02:23 +00:00
Preserve TUI status timing when the status row is hidden (#41913)
## Why Streaming can temporarily hide the status row, but its elapsed time is still needed when the row returns and when the final `Worked for` duration falls back to the local clock. Approval prompts must also keep that clock paused. ## What changed - Own the pause-aware status timer in the bottom pane independently of the optional status row. - Preserve elapsed time and modal pause state while hiding or restoring the row, and reset the clock for new turns and Windows sandbox setup. - Use the independent timer as the fallback for the final turn duration. ## Testing Add timer unit coverage and TUI tests for hidden rows, outstanding approvals, fallback turn durations, and fresh Windows sandbox setup clocks. GitOrigin-RevId: a77931e465d5aedd4a8cd606a3a3117d1bb37ce7
This commit is contained in:
1 parent
5f79a92e39
commit
17e8101699
10 files changed
+295
-147
No files matched your search
@@ -875,35 +875,43 @@ async fn unified_exec_wait_before_streamed_agent_message_snapshot() {
|
||||
|
||||
#[tokio::test]
|
||||
async fn final_worked_for_uses_cumulative_turn_duration_snapshot() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
handle_turn_started(&mut chat, "turn-1");
|
||||
for duration_ms in [Some(125_000), None] {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
handle_turn_started(&mut chat, "turn-1");
|
||||
|
||||
let exec = begin_exec_with_source(
|
||||
&mut chat,
|
||||
"call-1",
|
||||
"echo preparing",
|
||||
ExecCommandSource::Agent,
|
||||
);
|
||||
end_exec(&mut chat, exec, "preparing\n", "", /*exit_code*/ 0);
|
||||
let exec = begin_exec_with_source(
|
||||
&mut chat,
|
||||
"call-1",
|
||||
"echo preparing",
|
||||
ExecCommandSource::Agent,
|
||||
);
|
||||
end_exec(&mut chat, exec, "preparing\n", "", /*exit_code*/ 0);
|
||||
|
||||
complete_assistant_message(
|
||||
&mut chat,
|
||||
"msg-final",
|
||||
"Final response.",
|
||||
Some(MessagePhase::FinalAnswer),
|
||||
);
|
||||
handle_turn_completed(&mut chat, "turn-1", Some(125_000));
|
||||
chat.bottom_pane
|
||||
.reset_status_timer(Duration::from_secs(/*secs*/ 125));
|
||||
handle_agent_message_delta(&mut chat, "Final response.\n");
|
||||
chat.on_commit_tick();
|
||||
assert!(!chat.bottom_pane.status_indicator_visible());
|
||||
|
||||
let cells = drain_insert_history(&mut rx);
|
||||
let combined = cells
|
||||
.iter()
|
||||
.map(|lines| lines_to_single_string(lines))
|
||||
.collect::<String>();
|
||||
assert!(
|
||||
combined.contains("Worked for 2m 05s"),
|
||||
"expected final separator to use cumulative turn duration, got:\n{combined}"
|
||||
);
|
||||
assert_chatwidget_snapshot!("final_worked_for_uses_cumulative_turn_duration", combined);
|
||||
complete_assistant_message(
|
||||
&mut chat,
|
||||
"msg-final",
|
||||
"Final response.",
|
||||
Some(MessagePhase::FinalAnswer),
|
||||
);
|
||||
handle_turn_completed(&mut chat, "turn-1", duration_ms);
|
||||
|
||||
let cells = drain_insert_history(&mut rx);
|
||||
let combined = cells
|
||||
.iter()
|
||||
.map(|lines| lines_to_single_string(lines))
|
||||
.collect::<String>();
|
||||
assert!(
|
||||
combined.contains("Worked for 2m 05s"),
|
||||
"expected final separator to use cumulative turn duration, got:\n{combined}"
|
||||
);
|
||||
assert_chatwidget_snapshot!("final_worked_for_uses_cumulative_turn_duration", combined);
|
||||
}
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
||||
Reference in new issue
Block a user