feat(vscode): add image attachment path mode for MCP file path handling#8818
Open
Brightlyviryaa wants to merge 3 commits intoKilo-Org:mainfrom
Open
feat(vscode): add image attachment path mode for MCP file path handling#8818Brightlyviryaa wants to merge 3 commits intoKilo-Org:mainfrom
Brightlyviryaa wants to merge 3 commits intoKilo-Org:mainfrom
Conversation
1 task
packages/kilo-vscode/webview-ui/src/hooks/useImageAttachments.ts
Outdated
Show resolved
Hide resolved
packages/kilo-vscode/webview-ui/src/hooks/useImageAttachments.ts
Outdated
Show resolved
Hide resolved
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 files)
Reviewed by gpt-5.4-20260305 · 573,491 tokens |
- Add onDidChangeConfiguration listener to update webview when setting changes - Pass correct mime type through imageSaved message - Use filePath as-is (uri.toString() already includes file:// prefix)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Add a configurable
kilo-code.new.attachments.imageModesetting to control how attached images are sent to the CLI backend. When set to"path", images are saved as temp files and sent asfile://URLs instead of base64 data URLs. This enables smooth integration with MCP servers (like Z.AI image understanding) that expect file paths rather than raw image data.Implementation
The implementation adds a new VS Code configuration setting
attachments.imageModewith two values:"data"(default): current behavior, sendsdata:URLs"path": saves images to temp files (vscode.env.tempFilesStoragePath) and sendsfile://URLsFlow for path mode:
saveImageToTempmessage with base64 dataimageSavedcontainingfile://pathKey changes:
KiloProvider.ts: handlessaveImageToTempandrequestImageModemessagesImageModeContext.tsx: new context for reactive image mode stateuseImageAttachments.ts: conditionally sends to temp or reads as dataURL based on modePromptInput.tsx: listens forimageSavedmessages to handle async path responsesHow to Test
bun run extension)kilo-code.new.attachments.imageModeto"path"file://pathGet in Touch
Brightlyviryaa on Kilo Code Discord