Require confirmation for safety-buffered retries (#42380)

## What changed

- Show a confirmation before stopping a safety-buffered attempt and retrying
  with the server-selected faster model.
- Explain that the retry starts a new thread, preserves actions already taken,
  and may use a less capable model; allow the user to keep waiting instead.
- Dismiss the buffering or confirmation view when the response starts or the
  turn is no longer eligible for retry.
- Refresh the buffering copy and wrap confirmation text correctly in narrow
  terminals.

## Testing

- Cover retry confirmation, cancellation, turn completion, response startup,
  stale updates, and narrow-terminal rendering.

GitOrigin-RevId: 013bc47174811dd104b421774577c2808c732bfa
This commit is contained in:
Eric Traut authored and copyberry committed 2026-09-02 22:49:48 +00:00
1 parent 69cebb5d15
commit 0588fc941c
12 files changed
+287 -34

No files matched your search

@@ -0,0 +1,14 @@
---
source: tui/src/chatwidget/tests/app_server.rs
expression: "render_bottom_popup(&chat, 80)"
---
Stop this attempt and retry?
This will stop the current attempt and retry in a new thread. Any file
changes or other actions already taken will remain.
Your message will be sent again using Faster Model, which may be less
capable on complex tasks.
› 1. Keep waiting
2. Stop and retry
@@ -0,0 +1,17 @@
---
source: tui/src/chatwidget/tests/app_server.rs
expression: "render_bottom_popup(&chat, 40)"
---
Stop this attempt and retry?
This will stop the current attempt
and retry in a new thread. Any file
changes or other actions already
taken will remain.
Your message will be sent again
using Faster Model, which may be
less capable on complex tasks.
› 1. Keep waiting
2. Stop and retry
@@ -2,9 +2,9 @@
source: tui/src/chatwidget/tests/app_server.rs
expression: popup
---
Our systems are thinking a bit more about this request before responding.
Hang tight or retry with a faster model for a quicker response, though it
may be less capable of handling complex requests.
Giving this request a little extra thought
If you'd rather not wait, retry with a faster model. It may be less capable
of handling complex requests.
› 1. Retry with a faster model
2. Dismiss and keep waiting
@@ -2,7 +2,7 @@
source: tui/src/chatwidget/tests/app_server.rs
expression: popup
---
Our systems are thinking a bit more about this request before responding.
Giving this request a little extra thought
› 1. Dismiss and keep waiting
2. Learn more
@@ -2,7 +2,7 @@
source: tui/src/chatwidget/tests/app_server.rs
expression: popup
---
Our systems are thinking a bit more about this request before responding.
Giving this request a little extra thought
› 1. Dismiss and keep waiting
2. Learn more