fix(vscode): address review — show error toast, restrict button to sidebar/AM local, windowsHide

- Show toast on transfer failure instead of silently resetting
- Use explicit continueInWorktree prop (default false) so open-in-tab
  panels and other KiloProvider instances do not show the button
- Pass continueInWorktree from sidebar App.tsx and AgentManagerApp.tsx
- Add windowsHide:true to git-transfer.ts execFile calls
This commit is contained in:
marius-kilocode
2026-03-25 20:13:20 +01:00
parent 31c45911e2
commit 17679f468d
3 changed files with 14 additions and 7 deletions
@@ -34,7 +34,7 @@ function git(args: string[], cwd: string, stdin?: string): Promise<{ code: numbe
const child = cp.execFile(
"git",
args,
{ cwd, encoding: "utf8", maxBuffer: 64 * 1024 * 1024 },
{ cwd, encoding: "utf8", maxBuffer: 64 * 1024 * 1024, windowsHide: true },
(error, stdout, stderr) => {
if (!error) {
resolve({ code: 0, stdout, stderr })
+2 -2
View File
@@ -229,9 +229,9 @@ const AppContent: Component = () => {
return (
<div class="container">
<Switch fallback={<ChatView />}>
<Switch fallback={<ChatView continueInWorktree />}>
<Match when={currentView() === "newTask"}>
<ChatView onSelectSession={handleSelectSession} />
<ChatView onSelectSession={handleSelectSession} continueInWorktree />
</Match>
<Match when={currentView() === "marketplace"}>
<MarketplaceView />
@@ -8,6 +8,7 @@ import { Button } from "@kilocode/kilo-ui/button"
import { Icon } from "@kilocode/kilo-ui/icon"
import { Spinner } from "@kilocode/kilo-ui/spinner"
import { Tooltip } from "@kilocode/kilo-ui/tooltip"
import { showToast } from "@kilocode/kilo-ui/toast"
import { TaskHeader } from "./TaskHeader"
import { MessageList } from "./MessageList"
import { PromptInput } from "./PromptInput"
@@ -35,8 +36,8 @@ export const ChatView: Component<ChatViewProps> = (props) => {
const server = useServer()
// Show "Show Changes" only in the standalone sidebar, not inside Agent Manager
const isSidebar = () => worktreeMode === undefined
// Show "Continue in Worktree": explicit prop, or default to true in sidebar
const canContinueInWorktree = () => props.continueInWorktree ?? isSidebar()
// Show "Continue in Worktree": only when explicitly enabled via prop
const canContinueInWorktree = () => props.continueInWorktree === true
const id = () => session.currentSessionID()
const hasMessages = () => session.messages().length > 0
@@ -97,12 +98,18 @@ export const ChatView: Component<ChatViewProps> = (props) => {
}
const cleanup = vscode.onMessage((msg) => {
if (msg.type !== "continueInWorktreeProgress") return
const status = (msg as { status: string }).status
if (status === "done" || status === "error") {
const m = msg as { status: string; error?: string }
if (m.status === "done") {
setTransferring(false)
setTransferDetail("")
return
}
if (m.status === "error") {
setTransferring(false)
setTransferDetail("")
showToast({ title: m.error ?? "Failed to continue in worktree" })
return
}
setTransferDetail(labels[status] ?? "Working...")
})
onCleanup(cleanup)