Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.

Commit b7d8d0d

Browse files
authored
Merge pull request #429 from Kilo-Org/feat/vscode-worktree-image-attachments
feat(vscode): forward image attachments through worktree session creation
2 parents 90fe14e + ec99edf commit b7d8d0d

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

packages/kilo-vscode/src/agent-manager/AgentManagerProvider.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,17 @@ export class AgentManagerProvider implements vscode.Disposable {
196196
})
197197

198198
// Step 4: Send the first message directly via httpClient
199-
// TODO: When image/file attachments are supported, build the parts array
200-
// from msg.files the same way KiloProvider.handleSendMessage does.
201-
if (text) {
199+
const fileParts = ((msg.files ?? []) as Array<{ mime: string; url: string }>).map((f) => ({
200+
type: "file" as const,
201+
mime: f.mime,
202+
url: f.url,
203+
}))
204+
if (text || fileParts.length > 0) {
202205
try {
203-
const parts: Array<{ type: "text"; text: string }> = [{ type: "text", text }]
206+
const parts: Array<{ type: "text"; text: string } | { type: "file"; mime: string; url: string }> = [
207+
...fileParts,
208+
...(text ? [{ type: "text" as const, text }] : []),
209+
]
204210
await client.sendMessage(session.id, parts, worktree.path, {
205211
providerID: msg.providerID as string | undefined,
206212
modelID: msg.modelID as string | undefined,

packages/kilo-vscode/webview-ui/src/components/chat/PromptInput.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ export const PromptInput: Component = () => {
285285
providerID: sel?.providerID,
286286
modelID: sel?.modelID,
287287
agent: session.selectedAgent(),
288+
files: attachments,
288289
})
289290
} else {
290291
session.sendMessage(message, sel?.providerID, sel?.modelID, attachments)

packages/kilo-vscode/webview-ui/src/types/messages.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,7 @@ export interface CreateWorktreeSessionRequest {
736736
providerID?: string
737737
modelID?: string
738738
agent?: string
739+
files?: FileAttachment[]
739740
}
740741

741742
export type WebviewMessage =

0 commit comments

Comments
 (0)