Skip to content

fix(agent-manager): keep subagents out of tabs - #11536

Merged
marius-kilocode merged 8 commits into
mainfrom
kaput-breath
Jul 14, 2026
Merged

fix(agent-manager): keep subagents out of tabs#11536
marius-kilocode merged 8 commits into
mainfrom
kaput-breath

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

The OpenCode v1.14.51 integration in #11031 started forwarding versioned session creation events for background subagents. Agent Manager's existing root-session filter only applied to list results, so child sessions could still be adopted as follow-ups, admitted as top-level tabs, and persisted across restarts.

Treat parented sessions as non-navigable at every Agent Manager admission and rendering boundary. On startup, validate managed session IDs and remove children already persisted by affected builds. This keeps subagent activity within the parent transcript while preserving root sessions and pending-tab behavior.

Regression follow-up to #11031.

@kilo-code-bot

kilo-code-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • packages/kilo-vscode/tests/unit/navigate.test.ts
  • packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/navigate.ts
Previous Review Summaries (5 snapshots, latest commit 0a221c4)

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

Previous review (commit 0a221c4)

Status: 1 Issues Found | Recommendation: Address before merge

Overview

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

WARNING

File Line Issue
packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx 767 The new !state guard also matches local or unassigned root sessions, so a worktree can stay selected while an out-of-worktree transcript remains active.

Fix these issues in Kilo Cloud

Files Reviewed (1 files)
  • packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx - 1 issue

Previous review (commit 64607b9)

Status: 1 Issues Found | Recommendation: Address before merge

Overview

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

WARNING

File Line Issue
packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx 763 The new auto-restore effect can override a freshly selected worktree session before managedSessions() catches up, bouncing users back to an older tab.

Fix these issues in Kilo Cloud

Files Reviewed (1 files)
  • packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx - 1 issue

Previous review (commit 5a79cf9)

Status: 1 Issues Found | Recommendation: Address before merge

Overview

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

WARNING

File Line Issue
packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx 971 Worktree restore still treats unresolved managed sessions as selectable, so reopening a worktree before ancestry resolves can focus a leaked child session again.

Fix these issues in Kilo Cloud

Files Reviewed (4 files)
  • packages/kilo-vscode/src/KiloProvider.ts - 0 issues
  • packages/kilo-vscode/tests/unit/navigate.test.ts - 0 issues
  • packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx - 1 issue
  • packages/kilo-vscode/webview-ui/agent-manager/navigate.ts - 0 issues

Previous review (commit 908f3bd)

Status: 1 Issues Found | Recommendation: Address before merge

Overview

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

WARNING

File Line Issue
packages/kilo-vscode/webview-ui/agent-manager/navigate.ts 35 The new parentID === null gate stops fresh sparse sessions from being admitted, but leaked child tabs can still survive reconciliation because other code paths still treat parentID === undefined as a root.

Fix these issues in Kilo Cloud

Files Reviewed (3 files)
  • packages/kilo-vscode/src/KiloProvider.ts - 0 issues
  • packages/kilo-vscode/tests/unit/navigate.test.ts - 0 issues
  • packages/kilo-vscode/webview-ui/agent-manager/navigate.ts - 1 issue

Previous review (commit be7418f)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (11 files)
  • .changeset/quiet-agent-tabs.md
  • packages/kilo-vscode/src/KiloProvider.ts
  • packages/kilo-vscode/src/agent-manager/AgentManagerProvider.ts
  • packages/kilo-vscode/src/agent-manager/host.ts
  • packages/kilo-vscode/src/agent-manager/vscode-host.ts
  • packages/kilo-vscode/src/kilo-provider/followup-session.ts
  • packages/kilo-vscode/tests/unit/followup-session.test.ts
  • packages/kilo-vscode/tests/unit/kilo-provider-followup.test.ts
  • packages/kilo-vscode/tests/unit/navigate.test.ts
  • packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/navigate.ts

Reviewed by gpt-5.4-20260305 · Input: 162.1K · Output: 13.5K · Cached: 1.5M

Review guidance: REVIEW.md from base branch main

Comment thread packages/kilo-vscode/webview-ui/agent-manager/navigate.ts Outdated
# Conflicts:
#	packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx
Comment thread packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx Outdated
Comment thread packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx Outdated
Comment thread packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx Outdated
NJ-2020 pushed a commit to NJ-2020/kilocode that referenced this pull request Jul 4, 2026
# Conflicts:
#	packages/kilo-vscode/tests/unit/navigate.test.ts
#	packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx
#	packages/kilo-vscode/webview-ui/agent-manager/navigate.ts
@marius-kilocode
marius-kilocode merged commit a5e189c into main Jul 14, 2026
22 checks passed
@marius-kilocode
marius-kilocode deleted the kaput-breath branch July 14, 2026 07:53
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
fix(agent-manager): keep subagents out of tabs
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.

2 participants