Skip to content

fix: agent manager terminal follows context when switching to local mode#6360

Open
marius-kilocode wants to merge 2 commits intomainfrom
fix/agent-manager-local-terminal
Open

fix: agent manager terminal follows context when switching to local mode#6360
marius-kilocode wants to merge 2 commits intomainfrom
fix/agent-manager-local-terminal

Conversation

@marius-kilocode
Copy link
Collaborator

Summary

  • When switching from a worktree to local mode with a pending (new session) tab, currentSessionID() was undefined, causing the terminal keyboard shortcut (Cmd+/) and button click to silently do nothing.
  • Added showLocalTerminal message/handler that opens a terminal at workspace root when triggered in local mode without an active session.
  • Added showExistingLocalTerminal message/handler to auto-reveal the local terminal when switching contexts (mirrors the existing showExisting behavior for worktree sessions).

Changes

File Change
SessionTerminalManager.ts Added showLocalTerminal() method using __local__ key
AgentManagerProvider.ts Handle showLocalTerminal and showExistingLocalTerminal messages
AgentManagerApp.tsx Terminal triggers fall back to local terminal; selectLocal() sends showExistingLocalTerminal for pending tabs
messages.ts Added ShowLocalTerminalRequest and ShowExistingLocalTerminalRequest types
agent-manager-arch.test.ts Updated expected message handler list

When switching from a worktree to local mode with a pending tab,
currentSessionID() was undefined causing terminal triggers (Cmd+/ and
button click) to silently do nothing. Added a showLocalTerminal fallback
that opens a terminal at workspace root, and showExistingLocalTerminal
to auto-reveal the local terminal when switching contexts.
@kilo-code-bot
Copy link
Contributor

kilo-code-bot bot commented Feb 25, 2026

Code Review Summary

Status: 1 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0

Fix these issues in Kilo Cloud

Issue Details (click to expand)

WARNING

File Line Issue
packages/kilo-vscode/src/agent-manager/SessionTerminalManager.ts 67 Local terminal path-missing branch is silent (no user-visible warning), causing inconsistent UX versus session terminal flow.
Other Observations (not in diff)

No additional observations outside diff hunks.

Files Reviewed (5 files)
  • packages/kilo-vscode/src/agent-manager/AgentManagerProvider.ts - 0 issues
  • packages/kilo-vscode/src/agent-manager/SessionTerminalManager.ts - 1 issue
  • packages/kilo-vscode/tests/unit/agent-manager-arch.test.ts - 0 issues
  • packages/kilo-vscode/webview-ui/agent-manager/AgentManagerApp.tsx - 0 issues
  • packages/kilo-vscode/webview-ui/src/types/messages.ts - 0 issues

const cwd = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath
if (!cwd) {
this.log("showLocalTerminal: no workspace folder open")
return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: Local terminal failure is silent when no workspace is open

In SessionTerminalManager.showLocalTerminal(), this branch only logs and returns when cwd is missing, so the user gets no visible feedback after invoking terminal actions from local mode. SessionTerminalManager.showTerminal() already surfaces this case via showWarningMessage, so behavior is currently inconsistent and can look like a broken command.

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.

1 participant