Show live task details in the agent command center (#42455)

## What changed

- Add bounded detail previews for the selected task, including pending approval or user-input requests, live reasoning headings, and the latest agent message.
- Prefer the most urgent child task with useful detail while keeping the task list compact.
- Populate historical last messages from existing thread reads and update live details from already-delivered events without attaching to additional threads.
- Clear stale previews after reverts, event-stream gaps, reconnects, and thread lifecycle changes.

## Testing

- Add coverage and snapshots for attention requests, live activity, historical messages, stale refreshes, and attachment changes.

GitOrigin-RevId: 5de4b8aa3bc5bf9653a40c44b827f7aa85c8cf89
This commit is contained in:
Eric Traut authored and copyberry committed 2026-09-03 05:33:57 +00:00
1 parent c9fecd3fa0
commit 8ff74cc9b1
20 files changed
+757 -42

No files matched your search

+15
View File
@@ -28,6 +28,8 @@ pub(crate) const AGENTS_OVERVIEW_VIEW_ID: &str = "agents-overview";
pub(super) struct AgentsOverviewState {
/// Missing metadata records a local resume until the next metadata refresh.
pub(super) threads: HashMap<ThreadId, Option<Thread>>,
pub(super) last_messages: HashMap<ThreadId, String>,
pub(super) activity: HashMap<ThreadId, super::agents_overview_details::AgentsOverviewActivity>,
pub(super) initialized: bool,
pub(super) request_id: Option<Uuid>,
pub(super) refresh_pending: bool,
@@ -133,10 +135,15 @@ impl App {
match result {
Ok(refresh) => {
self.agents_overview.initialized = refresh.recent_seed_complete;
self.agents_overview
.last_messages
.extend(refresh.last_messages);
for (thread_id, thread) in refresh.threads {
if let Some(mut thread) = thread {
if thread.ephemeral {
self.agents_overview.threads.remove(&thread_id);
self.agents_overview.last_messages.remove(&thread_id);
self.agents_overview.activity.remove(&thread_id);
continue;
}
thread.turns.clear();
@@ -162,6 +169,13 @@ impl App {
std::mem::take(&mut self.agents_overview.refresh_notifications).into_values()
{
for notification in notifications {
if let ServerNotification::ThreadReverted(reverted) = &notification
&& let Ok(thread_id) = ThreadId::from_string(&reverted.thread_id)
{
// Discard stale read results without clearing activity received after the revert.
self.agents_overview.last_messages.remove(&thread_id);
continue;
}
self.track_agents_overview_notification(&notification);
}
}
@@ -253,6 +267,7 @@ impl App {
continue;
};
rows.push(AgentsOverviewRow {
details: self.agents_overview_details(root, &children),
thread: root.clone(),
thread_id,
group,