feat(jetbrains): add editor context and prompt attachments - #13015
Conversation
Include active editor files, open tabs, visible files, selected ranges, and shell metadata in JetBrains chat prompts so agents can infer the user's current editor context without manual attachment. Filter paths through .kilocodeignore or fallback gitignore/.env rules before sending them to the backend.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files, incremental)
Previous Review Summaries (7 snapshots, latest commit 9f32194)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 9f32194)Status: No Issues Found | Recommendation: Merge Files Reviewed (1 file, incremental)
Notes: incremental pass over commit Previous review (commit ad933a3)Status: No Issues Found | Recommendation: Merge Files Reviewed (11 files, incremental)
Notes: incremental pass over commit Previous review (commit 5c08bda)Status: No Issues Found | Recommendation: Merge Files Reviewed (6 files, incremental)
Notes: incremental pass over commit Previous review (commit aaf2820)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (8 files, incremental)
Notes: incremental pass over commits Fix these issues in Kilo Cloud Previous review (commit 9ebe1f6)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (14 files, incremental)
Notes: incremental pass over commits Fix these issues in Kilo Cloud Previous review (commit 74470aa)Status: 6 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (35 files)
Notes: incremental pass over the new prompt-attachments commit. The Fix these issues in Kilo Cloud Previous review (commit 62923ad)Status: 5 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (19 files)
Notes: the Reviewed by kimi-k3 · Input: 65.9K · Output: 11.3K · Cached: 864.2K Review guidance: REVIEW.md from base branch |
Address review feedback on the automatic editor-context PR: - Skip malformed .kilocodeignore/.gitignore globs instead of throwing PatternSyntaxException that broke every prompt send. - Add KiloIgnoreCache so the compiled matcher is cached per root and invalidated via a VFS listener, keeping the blocking (remote cwm) read off the prompt-send path after the first prompt. - Gather editor context only on the prompt path so slash commands and client actions no longer pay its cost or hit its failure modes. - Guard Path.of(file.path) against cross-OS invalid filenames, matching rootDir(). - Keep the local Auto-Include Editor Context toggle interactive regardless of backend readiness; it is a per-IDE preference, not CLI config. - Fix a replaced tool view (e.g. completed question) jumping above the prompt bubble on user messages.
Remove the rounded outline from compact prompt attachment chips and let the prompt attachment container own left, right, and bottom padding so attached selections align with the prompt text.
Remove the remaining border line from the prompt attachment scroll pane and keep only a small standard bottom inset below attached selections.
Skip prompt editor height and highlight recalculation while the editor document is in bulk update, then schedule one refresh after bulk mode exits so undo/redo cannot trigger UnexpectedBulkUpdateStateException. Also include the local Auto-Include Editor Context setting in the Context page draft state so toggling it marks the configurable modified and Apply persists it without sending a CLI config patch.
Remove the remaining prompt attachment strip border and reuse the shared underlined file-link styling for attachment chip labels so clickable files look consistent in the transcript.
Give the prompt input and the transcript user-prompt bubble a dedicated background that defaults to the editor's code-fragment (code block) color, via a new Kilo.Session.Prompt.Background theme key so it can be restyled independently. Attachment strip is transparent so the prompt surface shows through, and the prompt-bar mode/model/effort pickers now blend into that surface when idle while keeping the standard hover fill. The transcript bubble drops its outline unless the prompt shares the session background, in which case it keeps the original outline for contrast.
ContextDraft's default editor value reads a PropertiesComponent app service, so constructing it requires an initialized IntelliJ Application. As a plain unit test this only passed when another BasePlatformTestCase initialized the app first in the same fork, making it order-dependent. Extend BasePlatformTestCase so the Application is always available.
Use the sticky tail-follow intent instead of momentary viewport position when deciding whether batched session updates and newly sent prompts should continue auto-scrolling. This prevents turn-close layout changes, such as modified-files cards plus progress footer removal, from cancelling an in-flight follow-to-bottom pass.
feat(jetbrains): add editor context and prompt attachments
What's New
This PR improves JetBrains chat prompts so Kilo has more useful context by default and shows attached context more clearly in the transcript.
Features
Fixes
Demo
Editor selection is part of the context
Editor file is part of the context
Testing
Changesets