Skip to content

feat(jetbrains): open sub-agent sessions in editor tabs - #13255

Merged
kirillk merged 10 commits into
mainfrom
branch-pick
Aug 21, 2026
Merged

feat(jetbrains): open sub-agent sessions in editor tabs#13255
kirillk merged 10 commits into
mainfrom
branch-pick

Conversation

@kirillk

@kirillk kirillk commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Issue

No linked issue; implementation requested from the JetBrains sub-agent session editor parity plan.

Context

JetBrains task tool cards currently show child sessions only inline. VS Code can open sub-agent sessions in a separate read-only viewer, which makes child agent output easier to inspect and follow while preserving parent-session controls.

Implementation

Adds a JetBrains VFS-backed sub-agent session editor kind keyed by {sessionId, directory} so repeated opens dedupe to the same editor tab. The new host reuses SessionUi with a readonly SessionManager capability, hiding the composer and session-mutating controls while still streaming the child session transcript.

The task tool view now exposes a retained hover action when childSessionId is present, and the open callback is threaded through the existing transcript view stack so nested sub-agent task cards work inside read-only child viewers too. A small app-level title cache supplies stable editor tab labels without putting titles into the VFS identity.

Screenshots / Video

Screen Shot 2026-08-20 at 4 42 16 PM

How to Test

Manual/local verification

  • Agent ran ./gradlew typecheck from packages/kilo-jetbrains/.
  • Agent ran ./gradlew test from packages/kilo-jetbrains/.

Reviewer test steps

  1. Run a JetBrains session that invokes the task tool.
  2. Hover the task card header and click Open sub-agent in editor.
  3. Confirm a Kilo editor tab opens for the child session, has no prompt or compact/revert/reply controls, and shows the transcript.
  4. Open the same child again and confirm it reuses the existing tab.
  5. If the child session contains another task card, confirm that nested card can open another read-only editor tab.

Blocked checks and substitute verification

  • None.

Checklist

  • Issue linked above, or exception explained
  • Tests/verification described
  • Screenshots/video included for visual changes, or marked N/A
  • Changeset considered for user-facing changes
  • I personally reviewed the diff and can explain the changes, including any AI-assisted work.

Get in Touch

N/A

@kilo-code-bot

kilo-code-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (21 files)
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/ChangesCardView.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/ModifiedFilesView.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/permission/PermissionDiffView.kt
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_ar.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_bs.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_da.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_de.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_es.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_fr.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_ja.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_ko.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_nl.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_no.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_pl.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_pt_BR.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_ru.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_th.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_tr.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_uk.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_zh_CN.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_zh_TW.properties
Previous Review Summaries (7 snapshots, latest commit 009dd19)

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

Previous review (commit 009dd19)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/tool/TaskToolView.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/views/TaskToolViewTest.kt

Previous review (commit aac2898)

Status: 1 Issue 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-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/tool/TaskToolView.kt 64 Open-action placeholder is in the clipping fill slot, so long summaries can zero-width it
Files Reviewed (3 files)
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/popup/HeaderPopup.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/tool/TaskToolView.kt - 1 issue
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/views/TaskToolViewTest.kt

Fix these issues in Kilo Cloud

Previous review (commit 61f3892)

Status: 1 Issue 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-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/tool/TaskToolView.kt 63 Open-action placeholder is in the clipping fill slot, so long summaries can zero-width it
Files Reviewed (2 files)
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/tool/TaskToolView.kt - 1 issue
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/views/TaskToolViewTest.kt

Fix these issues in Kilo Cloud

Previous review (commit ba87c72)

Status: 1 Issue 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-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/tool/TaskToolView.kt 59 Open-action placeholder is in the clipping fill slot, so long summaries can zero-width it
Files Reviewed (1 files)
  • bun.lock

Fix these issues in Kilo Cloud

Previous review (commit 1f669a7)

Status: 1 Issue 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-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/tool/TaskToolView.kt 59 Open-action placeholder is in the clipping fill slot, so long summaries can zero-width it
Files Reviewed (1 files)
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/tool/TaskToolView.kt - 1 issue

Fix these issues in Kilo Cloud

Previous review (commit b65d11a)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (8 files)
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionUi.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/subagent/SubagentTitleCache.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/ModifiedFilesView.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/base/HeaderOpenAction.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/tool/EditToolView.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/tool/TaskToolView.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/subagent/SubagentSessionEditorKindTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/views/TaskToolViewTest.kt

Previous review (commit cbd4b1c)

Status: 2 Issues Found | Recommendation: Address before merge

Overview

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

WARNING

File Line Issue
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionUi.kt 894 openSubagent() never calls ensureSubagentSessionEditorKind() before VFS open, so the first click can fail silently

SUGGESTION

File Line Issue
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/subagent/SubagentTitleCache.kt 8 App-level title cache has no eviction or remove path
Files Reviewed (19 files)
  • .changeset/subagent-session-tabs.md
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionManager.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionUi.kt - 1 issue
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/subagent/SubagentSessionEditorHost.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/subagent/SubagentSessionEditorKind.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/subagent/SubagentTitleCache.kt - 1 issue
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/SessionMessageListPanel.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/header/SessionHeaderPanel.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/MessageView.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/TurnView.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/ViewFactory.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/tool/TaskToolView.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/vfs/KiloFileEditorProvider.kt
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle.properties
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/SessionUiLayoutTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/SessionUiTestBase.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/subagent/SubagentSessionEditorHostTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/subagent/SubagentSessionEditorKindTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/views/TaskToolViewTest.kt

Fix these issues in Kilo Cloud


Reviewed by grok-4.6 · Input: 226.3K · Output: 15K · Cached: 697.2K

Review guidance: REVIEW.md from base branch main

Call ensureSubagentSessionEditorKind() before opening the sub-agent VFS file so the first click reliably creates the virtual file, matching the diff and attachment open sites. Also cap SubagentTitleCache with an access-order LRU so high-churn child session ids do not accumulate for the IDE lifetime.
The sub-agent open control used a persistent header HoverIcon that never reliably opened the editor tab. Switch it to the same hover-overlay open-in-editor affordance the edit/patch and modified-files cards already use (SessionCopyTarget + open-diff icon), and extract that button+anchor wiring into a shared HeaderOpenAction so the three cards no longer duplicate it.
Append the open action to the flexible header slot so it sits right after the task summary like the edit/patch card, instead of pinned to the far-right header group.
Collapsed task cards now show the same hover popup as the edit/patch and changes cards. Instead of rebuilding a static snapshot, the popup reparents the live TaskBodyScroll the in-place expanded card uses, so streaming child tools keep updating inside the popup. The popup's disposable detaches the shared body on hide (unless the card reclaimed it by expanding) without disposing it, so it stays reusable across expand/collapse.
Streaming child tools no longer pack the whole IDE window. The task popup is now a fixed, bounded box: a 60-char floor width, the shared height cap, and both scrollbars, so live child updates scroll inside the balloon instead of resizing it. HeaderPopupBody gains opt-in minWidth/fixedHeight/horizontal params; snapshot popups keep their content-sized behavior.
The open-action anchor lived in the header fill slot, a fitHorizontal stack that clips trailing children to zero width. A long summary could starve the anchor so the hover open control failed to appear. Move the summary and anchor into the non-fit left group like the edit/patch cards, so the anchor always reserves its width right after the text.
# Conflicts:
#	packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionUi.kt
#	packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/ModifiedFilesView.kt
#	packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/tool/TaskToolView.kt
#	packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/SessionUiLayoutTest.kt
…anslations

Route ChangesCardView.Header's open-in-diff button through the shared HeaderOpenAction, matching the edit/patch and task cards, so the toolbarButton + hoverPlaceholder wiring lives in one place. Add the new sub-agent bundle keys (openSubagent, subagent.title, subagent.path) to all locale files.
@kirillk
kirillk enabled auto-merge August 20, 2026 20:48
@kirillk
kirillk merged commit a3c591e into main Aug 21, 2026
24 checks passed
@kirillk
kirillk deleted the branch-pick branch August 21, 2026 09:11
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