Skip to content

feat(agent-manager): add quick search for worktrees and sessions - #11294

Merged
marius-kilocode merged 4 commits into
mainfrom
mica-potassium
Jun 17, 2026
Merged

feat(agent-manager): add quick search for worktrees and sessions#11294
marius-kilocode merged 4 commits into
mainfrom
mica-potassium

Conversation

@marius-kilocode

@marius-kilocode marius-kilocode commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Agent Manager is intended to be a single place for moving between parallel tasks, but navigation currently depends on what is already visible in the sidebar or open in the current context. Returning to an older session, a collapsed section, or a previously selected worktree therefore requires manual browsing, and the existing tab switcher only covers tabs in the active context.

This adds a quick switcher beside the Worktrees heading that searches the complete set of useful Agent Manager destinations: the local workspace, persistent local sessions, managed worktrees, and persistent sessions assigned to those worktrees. Because managed worktrees are indexed independently of their currently open tabs, the switcher also makes it easy to return to worktrees used earlier. Pending New Session tabs, terminals, review tabs, and unassigned history sessions stay out of the index so results represent durable navigation targets rather than temporary UI state.

The interaction is optimized for keyboard navigation. A configurable Agent Manager command uses Cmd+F on macOS and Ctrl+F elsewhere, scoped to the active Agent Manager webview and excluded while the VS Code terminal has focus. Embedded Agent Manager terminals pass this chord back to the webview. Repeating the shortcut clears the current query and focuses the input, Enter opens the selected destination, and Escape or outside dismissal returns focus to the prompt. This keeps the primary flow to shortcut, type, Enter, then continue prompting, without leaving focus on the search button.

The result model deliberately separates browsing from searching. With an empty query, results are grouped into Sessions and Local & Worktrees, with sessions first because opening a specific conversation is the common quick-switch action. Once text is entered, group boundaries disappear and all destinations compete in one fuzzy-ranked list, preventing a lower-quality result from winning merely because it belongs to an earlier section. Titles are matched directly while searchable metadata includes worktree labels, branches, section names, and stable IDs.

Default ordering prioritizes destinations that need attention or are currently running, then destinations structurally visible in the expanded sidebar hierarchy, then recent activity. Structural visibility is used only as a stable tie-breaker. It is based on section expansion rather than viewport intersection or scroll position, so scrolling cannot reshuffle results while someone is choosing. During an active query, fuzzy relevance remains primary and these signals only resolve otherwise equivalent matches. Keyboard highlight movement does not mutate sidebar state.

Each row preserves enough context to distinguish similarly named tasks without making the list noisy: session rows show their local or worktree hierarchy, worktree rows show section and branch metadata, section colors remain visible, and rows expose relative activity time, session counts, running state, retry state, or waiting state as appropriate. Duplicate hierarchy labels are suppressed when a session title already matches its worktree label. The local workspace is presented as a first-class context with its branch, activity state, and persistent-session count rather than being implied by local session results.

Selection follows existing Agent Manager navigation semantics instead of creating a parallel state model. Choosing local restores its remembered session, terminal, or review state. Choosing a worktree restores that worktree context. Choosing a session first selects its owning context and then the exact session. If the destination belongs to a collapsed section, the section expands only after selection so hidden destinations remain searchable without changing the layout while arrows move through the list. The prompt receives focus after navigation.

The narrower top-bar tab search is removed to avoid two overlapping switchers with different scopes. Existing tab-cycle behavior remains available through its keyboard commands, while the sidebar switcher becomes the single discoverable search surface for cross-context navigation. Search indexing and ranking live in a pure helper for deterministic coverage, and the worktree header actions remain isolated from the main Agent Manager component so the integration does not deepen an already large view.

file-c0e0f7267c8e0385002053f644e1cd28 file-b29522bc100ed552191816884bd3aa55 file-13de87c91cfe4abe6df9a5b6a12e70e6

Fixes #10597

Comment thread packages/kilo-vscode/webview-ui/agent-manager/SidebarSearchMenu.tsx
@kilo-code-bot

kilo-code-bot Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 1 Issue Found | Recommendation: Suggest addressing

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/kilo-vscode/webview-ui/agent-manager/SidebarSearchMenu.tsx 149 Redundant ternary inside outer Show guard
Files Reviewed (18 files)
  • .changeset/search-agent-manager-sidebar.md
  • packages/kilo-vscode/package.json
  • packages/kilo-vscode/src/agent-manager/format-keybinding.ts
  • packages/kilo-vscode/src/extension.ts
  • packages/kilo-vscode/tests/accessibility.spec.ts
  • packages/kilo-vscode/tests/unit/agent-manager-arch.test.ts
  • packages/kilo-vscode/tests/unit/extension-arch.test.ts
  • packages/kilo-vscode/tests/unit/format-keybinding.test.ts
  • packages/kilo-vscode/tests/unit/sidebar-search.test.ts
  • packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/SidebarSearchMenu.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/SidebarToggleButton.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/WorktreeSectionActions.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/agent-manager.css
  • packages/kilo-vscode/webview-ui/agent-manager/sidebar-search.ts
  • packages/kilo-vscode/webview-ui/agent-manager/tab-rendering.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/terminal/TerminalTab.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/shortcuts.ts

Fix these issues in Kilo Cloud

Previous Review Summaries (2 snapshots, latest commit 5120e15)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 5120e15)

Status: 1 Issue Found | Recommendation: Suggest addressing

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/kilo-vscode/webview-ui/agent-manager/SidebarSearchMenu.tsx 149 Redundant ternary inside outer Show guard
Files Reviewed (18 files)
  • .changeset/search-agent-manager-sidebar.md
  • packages/kilo-vscode/package.json
  • packages/kilo-vscode/src/agent-manager/format-keybinding.ts
  • packages/kilo-vscode/src/extension.ts
  • packages/kilo-vscode/tests/accessibility.spec.ts
  • packages/kilo-vscode/tests/unit/agent-manager-arch.test.ts
  • packages/kilo-vscode/tests/unit/extension-arch.test.ts
  • packages/kilo-vscode/tests/unit/format-keybinding.test.ts
  • packages/kilo-vscode/tests/unit/sidebar-search.test.ts
  • packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/SidebarSearchMenu.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/SidebarToggleButton.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/WorktreeSectionActions.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/agent-manager.css
  • packages/kilo-vscode/webview-ui/agent-manager/sidebar-search.ts
  • packages/kilo-vscode/webview-ui/agent-manager/tab-rendering.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/terminal/TerminalTab.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/shortcuts.ts

Fix these issues in Kilo Cloud

Previous review (commit ed3eff8)

Status: 1 Issue Found | Recommendation: Suggest addressing

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/kilo-vscode/webview-ui/agent-manager/SidebarSearchMenu.tsx 149 Redundant ternary inside outer Show guard
Files Reviewed (17 files)
  • .changeset/search-agent-manager-sidebar.md
  • packages/kilo-vscode/package.json
  • packages/kilo-vscode/src/agent-manager/format-keybinding.ts
  • packages/kilo-vscode/src/extension.ts
  • packages/kilo-vscode/tests/accessibility.spec.ts
  • packages/kilo-vscode/tests/unit/agent-manager-arch.test.ts
  • packages/kilo-vscode/tests/unit/extension-arch.test.ts
  • packages/kilo-vscode/tests/unit/format-keybinding.test.ts
  • packages/kilo-vscode/tests/unit/sidebar-search.test.ts
  • packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/SidebarSearchMenu.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/WorktreeSectionActions.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/agent-manager.css
  • packages/kilo-vscode/webview-ui/agent-manager/sidebar-search.ts
  • packages/kilo-vscode/webview-ui/agent-manager/tab-rendering.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/terminal/TerminalTab.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/shortcuts.ts

Fix these issues in Kilo Cloud


Reviewed by deepseek-v4-pro-20260423 · 197,629 tokens

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit 632cef9 into main Jun 17, 2026
24 checks passed
@marius-kilocode
marius-kilocode deleted the mica-potassium branch June 17, 2026 09:53
LigiaZ added a commit that referenced this pull request Jun 17, 2026
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
feat(agent-manager): add quick search for worktrees and sessions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]:Add search for sessions list in Agent Manager

2 participants