Skip to content

feat(agent-manager): add embedded side-panel terminal destination - #12598

Merged
marius-kilocode merged 5 commits into
mainfrom
refactor-terminal-sidebar-integration
Jul 28, 2026
Merged

feat(agent-manager): add embedded side-panel terminal destination#12598
marius-kilocode merged 5 commits into
mainfrom
refactor-terminal-sidebar-integration

Conversation

@marius-kilocode

@marius-kilocode marius-kilocode commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Agent Manager's terminal button and the Focus Terminal shortcut always opened the VS Code integrated terminal at the bottom of the window. Users who live in the Agent Manager had to leave its layout to use a shell, and the bottom panel fights the chat for vertical space.

This adds a second destination for that action: an embedded terminal in the right-hand inspector that already hosts the diff view. The terminal button becomes a split button whose dropdown picks between VS Code terminal (default, unchanged behavior) and Agent Manager panel, persisted as the kilo-code.new.agentManager.terminalButtonDestination setting so the choice survives reloads.

How it behaves:

  • The side terminal shares the existing inspector host with the diff panel, with one resize handle and one remembered width per mode (terminal defaults to a third of the window, clamped to 360-640px).
  • The button and Cmd/Ctrl+/ toggle the panel like the diff toggle. Hiding keeps the PTY alive; the xterm instance stays mounted at zero opacity so scrollback and running processes survive, and the same instance is reused per context (worktree or local).
  • The header mirrors the diff panel's chrome and offers a single kill action (trash icon). Diff and terminal can be switched between freely without losing terminal state.
  • When the panel hides while the terminal held focus, focus returns to the chat composer so the type -> run command -> keep typing flow works without reaching for the mouse. Focus is never moved when it was elsewhere.
  • Terminal records now carry a placement (tab vs side) end to end, so side terminals stay out of the tab strip, tab order, and session replacement logic. Side-terminal creates are correlated with a createId (deliberately not the generic requestId channel) so a create that lands after the user closed the panel or switched context is closed instead of leaked. Tab creates keep their existing create-and-navigate behavior.
  • Closing the Agent Manager panel now also disposes its PTYs, and a router disposal invalidates in-flight creates instead of reviving them.

Scope: one side terminal per context. Follow-ups are tracked separately: per-worktree session terminals following the same destination (#12595) and multiple terminals per panel (#12597).

Agent Manager with the embedded side terminal open beside the chat

Terminal button dropdown picking between VS Code terminal and Agent Manager panel

Kill terminal action in the side panel header

marius-kilocode and others added 4 commits July 28, 2026 13:35
The Agent Manager terminal button and Focus Terminal shortcut can now
open a terminal in the right-hand inspector next to the diff panel
instead of the VS Code integrated terminal. A split-button dropdown on
the toolbar picks the destination and persists it as the
kilo-code.new.agentManager.terminalButtonDestination setting (default:
vscode, preserving existing behavior).

The side terminal shares the existing inspector host with the diff
view, keeps running while hidden, toggles via the same button or
shortcut, and hands focus back to the chat composer when minimized.
Each context (worktree or local) gets one reusable side terminal with
its own remembered panel width.
…name

kilo-ui's IconButton forwards label as an inert HTML attribute rather
than an accessible name, so the header action failed the WCAG
button-name check in the visual regression accessibility run. Use
aria-label, which Kobalte forwards to the button element.
Comment thread packages/kilo-vscode/webview-ui/agent-manager/terminal/state.ts
Comment thread packages/kilo-vscode/webview-ui/agent-manager/terminal/state.ts
@kilo-code-bot

kilo-code-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

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-vscode/webview-ui/agent-manager/terminal/state.ts 563 createId correlation/cancellation only covers side-placement creates; tab-placement creates have no equivalent guard against landing after the user moved on

SUGGESTION

File Line Issue
packages/kilo-vscode/webview-ui/agent-manager/terminal/state.ts 313 requests map entry for a cancelled side-create is only cleaned up when a response eventually arrives; a dropped/never-answered create leaks the entry
Files Reviewed (2 files)
  • .kilo/plans/agent-manager-side-terminal-fixes.md (deleted, no code change)
  • .kilo/plans/agent-manager-side-terminal.md (deleted, no code change)

This incremental review only covers the diff since the last review pass. No new code changes were introduced — the only change is the removal of two internal planning docs under .kilo/plans/. The two previously reported findings in state.ts remain unresolved since that file was not touched.

Fix these issues in Kilo Cloud

Previous Review Summary (commit d9289e1)

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

Previous review (commit d9289e1)

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-vscode/webview-ui/agent-manager/terminal/state.ts 563 createId correlation/cancellation only covers side-placement creates; tab-placement creates have no equivalent guard against landing after the user moved on

SUGGESTION

File Line Issue
packages/kilo-vscode/webview-ui/agent-manager/terminal/state.ts 313 requests map entry for a cancelled side-create is only cleaned up when a response eventually arrives; a dropped/never-answered create leaks the entry
Files Reviewed (49 files)
  • .changeset/agent-manager-side-terminal.md
  • .kilo/plans/agent-manager-side-terminal-fixes.md
  • .kilo/plans/agent-manager-side-terminal.md
  • packages/kilo-vscode/package.json
  • packages/kilo-vscode/src/agent-manager/AgentManagerProvider.ts
  • packages/kilo-vscode/src/agent-manager/terminal-destination.ts
  • packages/kilo-vscode/src/agent-manager/terminal-routing.ts
  • packages/kilo-vscode/src/agent-manager/types.ts
  • packages/kilo-vscode/tests/accessibility.spec.ts
  • packages/kilo-vscode/tests/unit/agent-manager-arch.test.ts
  • packages/kilo-vscode/tests/unit/agent-manager-i18n.test.ts
  • packages/kilo-vscode/tests/unit/agent-manager-terminal-destination.test.ts
  • packages/kilo-vscode/tests/unit/agent-manager-terminal-font.test.ts
  • packages/kilo-vscode/tests/unit/agent-manager-terminal-routing.test.ts
  • packages/kilo-vscode/tests/unit/agent-manager-terminal-side.test.ts
  • packages/kilo-vscode/tests/unit/agent-manager-terminal-state.test.ts
  • packages/kilo-vscode/tests/unit/extension-arch.test.ts
  • packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/agent-manager.css
  • packages/kilo-vscode/webview-ui/agent-manager/i18n/*.ts (20 locales)
  • packages/kilo-vscode/webview-ui/agent-manager/terminal/SideTerminalPanel.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/terminal/TerminalDestinationButton.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/terminal/TerminalTab.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/terminal/index.ts
  • packages/kilo-vscode/webview-ui/agent-manager/terminal/render.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/terminal/side.ts
  • packages/kilo-vscode/webview-ui/agent-manager/terminal/state.ts - 2 issues
  • packages/kilo-vscode/webview-ui/src/stories/agent-manager.stories.tsx
  • packages/kilo-vscode/webview-ui/src/types/messages/agent-manager.ts
  • packages/kilo-vscode/webview-ui/src/types/messages/extension-messages.ts
  • packages/kilo-vscode/webview-ui/src/types/messages/webview-messages.ts
  • packages/kilo-docs/public/img/.../side-terminal-panel-empty-chromium-linux.png (new visual-regression baseline, not reviewed)

Fix these issues in Kilo Cloud


Reviewed by claude-sonnet-5 · Input: 30 · Output: 7.9K · Cached: 652.2K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit 77812db into main Jul 28, 2026
25 checks passed
@marius-kilocode
marius-kilocode deleted the refactor-terminal-sidebar-integration branch July 28, 2026 12:57
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
…ebar-integration

feat(agent-manager): add embedded side-panel terminal destination
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