diff --git a/packages/kilo-vscode/package.json b/packages/kilo-vscode/package.json index d8c72aec7c8..8fcd0ce742a 100644 --- a/packages/kilo-vscode/package.json +++ b/packages/kilo-vscode/package.json @@ -50,6 +50,17 @@ ], "main": "./dist/extension.js", "contributes": { + "taskDefinitions": [ + { + "type": "kilo-worktree-setup", + "properties": { + "script": { + "type": "string", + "description": "The setup script command to execute" + } + } + } + ], "viewsContainers": { "activitybar": [ { diff --git a/packages/kilo-vscode/src/agent-manager/AgentManagerProvider.ts b/packages/kilo-vscode/src/agent-manager/AgentManagerProvider.ts index 1c6f285a539..db6f79add15 100644 --- a/packages/kilo-vscode/src/agent-manager/AgentManagerProvider.ts +++ b/packages/kilo-vscode/src/agent-manager/AgentManagerProvider.ts @@ -927,9 +927,9 @@ export class AgentManagerProvider implements Disposable { continue } - await this.runSetupScriptForWorktree(wt.result.path, wt.result.branch) + await this.runSetupScriptForWorktree(wt.result.path, wt.result.branch, wt.worktree.id) - const session = await this.createSessionInWorktree(wt.result.path, wt.result.branch) + const session = await this.createSessionInWorktree(wt.result.path, wt.result.branch, wt.worktree.id) if (!session) { const state = this.getStateManager() const manager = this.getWorktreeManager() @@ -942,7 +942,7 @@ export class AgentManagerProvider implements Disposable { const state = this.getStateManager()! state.addSession(session.id, wt.worktree.id) this.registerWorktreeSession(session.id, wt.result.path) - this.notifyWorktreeReady(session.id, wt.result) + this.notifyWorktreeReady(session.id, wt.result, wt.worktree.id) // Set the per-version model immediately so the UI selector reflects // the correct model as soon as the worktree appears, before Phase 2. @@ -1420,6 +1420,7 @@ export class AgentManagerProvider implements Disposable { status: "error", message: `Setup script failed: ${msg}`, branch, + worktreeId, }) } } diff --git a/packages/kilo-vscode/src/agent-manager/task-runner.ts b/packages/kilo-vscode/src/agent-manager/task-runner.ts index 0c9e7fa7c46..1329939e274 100644 --- a/packages/kilo-vscode/src/agent-manager/task-runner.ts +++ b/packages/kilo-vscode/src/agent-manager/task-runner.ts @@ -28,7 +28,16 @@ export async function executeVscodeTask(config: SetupTaskConfig): Promise { let done = false