Restore agent navigation after TUI reconnects (#41918)

## What changed

- Keep the agent command center visible with its cached inventory and draft while reconnecting, then refresh it without losing the selected task.
- Allow cached, unavailable conversations to reattach when selected while preserving their drafts, recap progress, and runtime permissions.
- Report an unsubmitted rename when its target disappears during refresh, and continue to quarantine queued input instead of resending it automatically.

## Testing

- Add a Unix socket replacement test covering command-center recovery with and without an active conversation, failed reconnects, inventory changes, and subsequent live task input.

GitOrigin-RevId: 774aca2dfb8358e9abd6a2e2ef0d509646648f66
This commit is contained in:
Eric Traut authored and copyberry committed 2026-08-31 21:59:56 +00:00
1 parent 0a2e2bf957
commit 746798b2f7
11 files changed
+752 -43

No files matched your search

@@ -3,7 +3,7 @@ source: tui/src/app/tests/disconnect_tests.rs
expression: "render_bottom_popup(&app.chat_widget, 100)"
---
Agent command center
Disconnected — agent list is stale
Reconnecting — agent list is stale
────────────────────────────────────────────────────────────────────────────────────────────────
│
│
@@ -0,0 +1,28 @@
---
source: tui/src/app/tests/navigation_reconnect_tests.rs
expression: "render_bottom_popup(&app.chat_widget, 100)"
---
Agent command center
Reconnect failed — agent list is stale; relaunch to retry
────────────────────────────────────────────────────────────────────────────────────────────────
/tmp/project 2 │ Task details
› ● Selected task Working │
○ Vanished task Ready │ Selected task
│ ● Working
│
│ Project
│ /tmp/project
│
│ Latest activity
│ Selected task
│
│
│
│
│
│
│
│
│
New task › Keep this task draft!
ctrl+c quit · actions paused until the list is refreshed
@@ -0,0 +1,28 @@
---
source: tui/src/app/tests/navigation_reconnect_tests.rs
expression: "render_bottom_popup(&app.chat_widget, 100)"
---
Agent command center
Reconnecting — agent list is stale
────────────────────────────────────────────────────────────────────────────────────────────────
/tmp/project 2 │ Task details
› ● Selected task Working │
○ Vanished task Ready │ Selected task
│ ● Working
│
│ Project
│ /tmp/project
│
│ Latest activity
│ Selected task
│
│
│
│
│
│
│
│
│
New task › Keep this task draft!
ctrl+c quit · actions paused until the list is refreshed
@@ -0,0 +1,28 @@
---
source: tui/src/app/tests/navigation_reconnect_tests.rs
expression: "render_bottom_popup(&app.chat_widget, 100)"
---
Agent command center
0 need input 1 working 1 ready
────────────────────────────────────────────────────────────────────────────────────────────────
/tmp/project 2 │ Task details
› ● New task Working │
○ Selected task Ready │ New task
│ ● Working
│
│ Project
│ /tmp/project
│
│ Latest activity
│ New task
│
│
│
│
│
│
│
│
│
New task › Describe a task and press enter to dispatch it
↑↓ navigate enter open ctrl+f search ctrl+s group ctrl+r rename ctrl+x stop esc back
@@ -0,0 +1,11 @@
---
source: tui/src/app/tests/navigation_reconnect_tests.rs
expression: "format!(\"{content}\\n{}\", render_bottom_popup(&app.chat_widget, 80))"
---
Cached previous conversation
• This conversation is unavailable. Its cached transcript and draft remain here; input is paused. Open the agent picker or return to the parent to continue.
• Reconnected. No input was resent. Review uncertain submissions before retrying; recovered queues remain paused.
› latest draft
gpt-test default · /tmp/project