Simplify the agents view - #2087
Conversation
There was a problem hiding this comment.
🟡 Medium
Clearing search after selecting an inactive session leaves Enter stuck on “Waiting for the selected session to load,” even though the saved catalog is already loaded. restoreSelection() sets selectionAnchorPending when compactSessionRows hides the selected row, and queryChanged() then skips syncSelectedRowState(), so the visible fallback row never becomes the active selection; clear the pending anchor when the catalog is settled.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @packages/coding-agent/src/modes/agents-view/agents-view-mode.ts around line 1333:
Clearing search after selecting an inactive session leaves Enter stuck on “Waiting for the selected session to load,” even though the saved catalog is already loaded. `restoreSelection()` sets `selectionAnchorPending` when `compactSessionRows` hides the selected row, and `queryChanged()` then skips `syncSelectedRowState()`, so the visible fallback row never becomes the active selection; clear the pending anchor when the catalog is settled.
Evidence trail:
fa08be2; packages/coding-agent/src/modes/agents-view/agents-view-mode.ts:1296-1303, 1322-1334, 1402-1410, 2213-2270, 2319-2357; packages/coding-agent/src/modes/agents-view/agents-view-state.ts:715-727
| return markRow(formatTableCell(theme.fg("error", title), width)); | ||
| } | ||
| const icon = this.formatRowIcon(row.section, this.getRowIcon(row.section)); | ||
| const expand = row.descendantCount > 0 ? (this.expandedSubagentParents.has(row.identity) ? "▾" : "▸") : " "; |
There was a problem hiding this comment.
🟡 Medium agents-view/agents-view-mode.ts:2572
A parent matching the search renders ▸ even when none of its children remain in the filtered rows, and expanding it changes the marker to ▾ without revealing anything. row.descendantCount comes from the unfiltered computeRecursiveRollups(...); drive this control from the filtered hierarchy so it is shown only when visible children can actually be expanded.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @packages/coding-agent/src/modes/agents-view/agents-view-mode.ts around line 2572:
A parent matching the search renders `▸` even when none of its children remain in the filtered rows, and expanding it changes the marker to `▾` without revealing anything. `row.descendantCount` comes from the unfiltered `computeRecursiveRollups(...)`; drive this control from the filtered hierarchy so it is shown only when visible children can actually be expanded.
Evidence trail:
Commit fa08be2. `packages/coding-agent/src/modes/agents-view/agents-view-mode.ts:1314-1320` passes filtered records alongside rollups from `this.unifiedRecords`; `:2572` renders the marker from `row.descendantCount`; `:980-983` toggles when that count is positive. `packages/coding-agent/src/modes/agents-view/agents-view-state.ts:408-424` filters records, and `:774-818` builds child relationships only from those filtered records while retaining the unfiltered rollup count.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit fa08be2. Configure here.
| this.clearStickyStatusMessage(); | ||
| if (this.showActions) { | ||
| this.showActions = false; | ||
| this.ui.requestRender(); | ||
| if (this.keybindings.matches(data, "app.shortcuts") || this.keybindings.matches(data, "tui.select.cancel")) | ||
| return; | ||
| } |
There was a problem hiding this comment.
🟡 Medium agents-view/agents-view-mode.ts:916
When the actions view is visible, any key other than app.shortcuts or tui.select.cancel both dismisses it and continues into normal input handling. Pressing the delete shortcut therefore immediately starts the selected agent's stop/delete flow instead of merely closing the actions view. Return after dismissing showActions so the dismissal key is consumed.
- if (this.showActions) {
- this.showActions = false;
- this.ui.requestRender();
- if (this.keybindings.matches(data, "app.shortcuts") || this.keybindings.matches(data, "tui.select.cancel"))
- return;
- }
+ if (this.showActions) {
+ this.showActions = false;
+ this.ui.requestRender();
+ return;
+ }🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @packages/coding-agent/src/modes/agents-view/agents-view-mode.ts around lines 916-922:
When the actions view is visible, any key other than `app.shortcuts` or `tui.select.cancel` both dismisses it and continues into normal input handling. Pressing the delete shortcut therefore immediately starts the selected agent's stop/delete flow instead of merely closing the actions view. Return after dismissing `showActions` so the dismissal key is consumed.
Evidence trail:
Commit dc67428; packages/coding-agent/src/modes/agents-view/agents-view-mode.ts:917-922, 944-947, 1882-1891; packages/coding-agent/src/core/keybindings.ts:161; packages/coding-agent/test/agents-view-mode.test.ts:943-958
…2068) * feat(coding-agent): show the model label on every agents-view row Resident summaries carry model info for all session kinds; only the renderer restricted the label to subagent rows. Drop the special case so any row whose summary has a model renders provider/id[:thinkingLevel] in the suffix region, still suppressed while pending delete/kill. * fix(coding-agent): open visible sessions without waiting for selection anchors Consolidates #2079 at d5b4926. * feat(tui): open local file links Consolidates #2073 at b6e83f0. * feat(coding-agent): highlight file references and command options Consolidates #1145 at 285ccf4. * feat: refresh Prime Inference models from the live catalog Consolidates #1928 at 24d3413. * feat(coding-agent): let root agents create sibling sessions Consolidates #1996 at 0c9c883. * feat(coding-agent): wake agents when asynchronous bash finishes Consolidates #2053 at 1bb4d43. * feat(coding-agent): simplify the agents view while retaining model details Consolidates #2087 at dc67428. Retains #2068 model visibility and #2079 immediate opening and query ownership. * fix(coding-agent): preserve background work and sibling-session credentials Keep managed shell commands active until completion delivery is accepted. Forward only effective same-provider transient auth when creating root sessions. Integration fixes for #2053 and #1996. * fix(coding-agent): address session lifecycle and rendering regressions Preserve sibling PATH and reject root creation after disposal. Treat background completions as new runs without duplicate as_completed wakes. Keep table delimiters visible and sanitize live catalog display metadata. Scope the stale-auth regression fixture to its cached Prime team. * fix(coding-agent): forward the selected provider environment credentials Preserve alias priority and runtime credential identity when creating sibling sessions. Pin that a create timeout never dispatches the task prompt. * fix(runtime): recheck creating-cell waits when shell commands settle Preserve late as_completed consumers without suppressing detached completion notices. Document the cached-wrapper result limitation. * fix(runtime): preserve background bash completion lifecycle Wait for process-group cleanup before releasing residency. Defer paused admission within the original request and report terminal rejection. Preserve notices after cancelled non-owning waits and clean up interrupted task construction. * fix(runtime): use a portable signal for construction cleanup Keep immediate POSIX cleanup and use the existing Windows job cleanup path without referencing SIGKILL. * fix(coding-agent): steer shell messages and stop losing supervisor launches Deliver labeled shell completion messages at the next safe turn boundary. Stop only an owned replacement child that loses to a current authenticated supervisor. --------- Co-authored-by: Seth <seth@primeintellect.ai>
Brings back the #2056 row format that #2087's consolidation replaced: per-row 'in/out tokens · own cost · descendant count · recursive total · age' with one shared column layout per section (column width = max of the widest section value and the legend label, all right-aligned) and the bold usage legend right-aligned on every section header. The redesign's other features stay: the Model column (compact ids) sits between the session title and the usage cell, Activity still shrinks first at narrow widths, expandable child sessions, the running-subagents line, and the actions panel are untouched. Usage cells right-align to the terminal edge, so age columns line up across sections even when a wide row widens only its own section. Fixes RES-1317.

Summary
N subagents runningline only while subagents are working; expanded agents and idle subagent lists have no extra summary line.?.Model IDs use existing session metadata. Sessions without model metadata show
-; full provider/model and reasoning level are available in details. No daemon protocol changes.Validation
npm run checknpx tsx ../../node_modules/vitest/dist/cli.js --run test/agents-view-mode.test.ts(frompackages/coding-agent)Rendered preview
Fixture sessions at 80 columns (logo, metadata, and search remain above the table):
Note
Low Risk
UI-only changes in the agents view TUI with no daemon protocol changes; behavior shifts (hidden inactive sessions, Enter opens parents) are covered by updated tests.
Overview
Redesigns the agents view into a compact table while keeping the splash, startup notices, and search.
Layout and columns: Per-section token/
$agentlegends andsubagent-summaryrows are gone. One shared header (Session · Model · Activity · Cost · Age) sits above Running/Idle/Inactive blocks. Rows show model id, activity text, recursive cost (includes subagents), and age; token columns are removed. Collapsed parents with running subagents get a short “N subagents running” line instead of a summary row.Navigation and keys: Inactive top-level sessions are hidden by default (
compactSessionRows); Alt+I toggles them (search still surfaces matches). Alt+Right expands/collapses subagents from the parent row; Enter on a parent opens the session (no longer toggles a summary row).?opens an actions overlay (shortcuts plus token/cost details for the selection) and closes on the next keypress.Persistence:
inactiveExpandedand splitallRows/rowskeep counts accurate while the visible list stays compact.Reviewed by Cursor Bugbot for commit dc67428. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Simplify agents view with compact layout, collapsed inactive sessions, and actions panel
Alt+Itoggles their visibility and search queries reveal them automatically. Inactive state persists across rebuilds viaAgentsViewPersistentState.inactiveExpanded.Alt+Righttoggles descendants on the selected row, andEnternow opens the parent session directly.?) that shows key commands plus selected-session metadata (model, thinking level, directory, token counts, session cost, recursive cost). The first input after opening the panel closes it.Enteron a parent agent no longer toggles a subagent-summary row (those rows are removed);targetHasSpawnCodeandgetAgentCountsTextnow read fromallRows(the unfiltered set) rather than visible compact rows; the default footer advertises generic navigation/open/actions instead of context-specific commands. The single column header consumes one viewport row, shifting existing viewport/ellipsis expectations.Macroscope summarized dc67428.