Prepare automatic TUI recap generation (#40697)

## What changed

- Schedule recap eligibility checks when an unfocused thread changes, and cancel them when focus returns or recap state is replaced.
- Add bounded structured recap requests with stale-result rejection, normalized output, and one retry per turn revision.
- Harden temporary structured threads by reading the effective configuration and disabling all discovered MCP servers, tools, skills, and environment access.

## Testing

- Cover recap timers, focus changes, failed turns, output bounds, stale results, and retry behavior.

GitOrigin-RevId: eebf50059763928e9a2444b14d51648e0bdff4a8
This commit is contained in:
Felipe Coury authored and copyberry committed 2026-08-25 20:56:03 +00:00
1 parent 7c1e36c23f
commit 40ba7da7b4
8 files changed
+788 -80

No files matched your search

+9 -1
View File
@@ -775,7 +775,15 @@ impl App {
match &event {
TuiEvent::FocusLost => {
self.recap.note_focus_lost(Instant::now());
let now = Instant::now();
let thread_id = self.current_displayed_thread_id();
self.recap.note_focus_lost(now);
if let Some(thread_id) = thread_id {
self.recap
.schedule_check(thread_id, self.app_event_tx.clone(), now);
}
}
TuiEvent::FocusGained => {
self.recap.note_focus_gained();