Skip to content

feat(jetbrains): add editor context and prompt attachments - #13015

Merged
kirillk merged 10 commits into
mainfrom
colossal-wizard
Aug 10, 2026
Merged

feat(jetbrains): add editor context and prompt attachments#13015
kirillk merged 10 commits into
mainfrom
colossal-wizard

Conversation

@kirillk

@kirillk kirillk commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

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

  • Automatically include editor context when sending chat messages.
  • Include the active file, open files, visible files, selected text, and shell context when available.
  • Add a Context setting to turn Auto-Include Editor Context on or off.
  • Show selected text and attached files as compact prompt attachment references in user messages.
  • Open attached file and selection references from the transcript.
  • Respect ignore rules so excluded files and sensitive env files are not included automatically.
  • Improve prompt logs so included context is easier to confirm while testing.

Fixes

  • Enable Apply when Auto-Include Editor Context is toggled in Settings.
  • Avoid prompt editor crashes during undo/redo bulk updates.
  • Keep slash commands and client actions from doing unnecessary editor-context work.
  • Handle malformed ignore patterns without breaking prompt sends.
  • Cache ignore-file matching so prompt sends do less repeated work.
  • Handle invalid cross-OS file paths without failing prompt sends.
  • Keep completed question/tool views in the right transcript position.
  • Keep JetBrains chat pinned to the bottom when a turn ends after modified files appear, so the scroll button hides correctly and the next prompt autoscrolls.
  • Refine prompt attachment styling: remove extra outlines, align spacing with prompt text, and keep a small bottom inset.

Demo

Editor selection is part of the context

GIF Recording 2026-08-10 at 11 26 48 AM

Editor file is part of the context

Screen Shot 2026-08-10 at 11 31 50 AM

Testing

  • Added coverage for editor context gathering, ignore matching, prompt attachment rendering, settings behavior, prompt undo/redo bulk updates, transcript placement, and scroll follow-through after modified-file turn completion.
  • Verified with JetBrains typecheck and focused frontend/backend tests.
  • Pre-push typechecks passed for JetBrains and the rest of the repo.

Changesets

  • Added a JetBrains changeset for automatic editor context.
  • Added a JetBrains changeset for prompt attachment rendering.

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.
@kilo-code-bot

kilo-code-bot Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files, incremental)
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionUi.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/SessionScrollTest.kt
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)
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/settings/context/ContextSettingsStateTest.kt

Notes: incremental pass over commit 9f32194345 (stabilize ContextSettingsStateTest against platform app). The test class now extends BasePlatformTestCase, which is required and correct: ContextDraft's default editor value calls KiloPluginSettings.getAutoEditorContext()PropertiesComponent.getInstance(), an app service unavailable in plain unit tests (verified against ContextSettingsState.kt and KiloPluginSettings.kt). Test methods were renamed with the test prefix to match the JUnit 3 naming contract of BasePlatformTestCase, the now-unused kotlin.test.Test import was dropped, and the emptyList<String>() type argument makes the watcher assertion explicit. No production code changed; no leak or behavior risk introduced.

Previous review (commit ad933a3)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (11 files, incremental)
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/prompt/PromptAttachmentStrip.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/prompt/PromptPanel.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/style/SessionEditorStyle.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/style/SessionUiStyle.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/MessageView.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/PromptView.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/ui/PickerButton.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/ui/UiStyle.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/ui/md/MdCommon.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/ui/PromptPanelTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/views/TextViewTest.kt

Notes: incremental pass over commit ad933a31df (align prompt background with code fragments). The new SessionUiStyle.View.Prompt.bgColor named-color key defaults to the shared UiStyle.Colors.codeBlockBackground helper; the MdCommon refactor is behavior-preserving (editorBackground == editorScheme.defaultBackground). applyPromptToEditor's new background parameter defaults to editorBackground, so the remaining caller (QuestionView) keeps prior behavior. The user-bubble outline is now drawn only when the prompt fill matches the editor background (no fill contrast), matching the PR's outline-removal intent. PickerButton.idleFill is a plain nullable property — no new listeners, subscriptions, or retained resources were introduced (no leak risk). Tests were updated consistently and exercise the new code-block-background path.

Previous review (commit 5c08bda)

Status: No Issues Found | Recommendation: Merge

Files Reviewed (6 files, incremental)
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/FileLinkText.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/attachment/AttachmentCard.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/PromptAttachmentView.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/tool/ToolSupport.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/ui/SessionUiUpdateTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/views/PromptAttachmentViewTest.kt

Notes: incremental pass over commit 5c08bda580. The single() extraction into shared fileLinkText/fileLinkHtml helpers is behavior-preserving — label text is HTML-escaped, FileLinkLabel.label keeps plain text for subtitleText, and message copy reads from the model (copyMarkdown), not label text. The scroll pane's null → empty-border change correctly prevents LaF-installed borders. No new listeners, subscriptions, or retained resources were introduced (no leak risk). The previously carried suggestion about AttachmentChip styling reaching assistant-message attachments is closed: the author confirmed the shared chip styling is intended in both places, and this commit deliberately extends it (underline) via the same component.

Previous review (commit aaf2820)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/attachment/AttachmentCard.kt 87 Removing AttachmentChip's background/outline painting also restyles AttachmentView chips on assistant messages, beyond the prompt-attachment scope named in the commit
Files Reviewed (8 files, incremental)
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/prompt/PromptPanel.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/PromptAttachmentView.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/settings/context/ContextSettingsState.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/settings/context/ContextSettingsUi.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/ui/PromptPanelTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/ui/SessionUiUpdateTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/views/PromptAttachmentViewTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/settings/context/ContextSettingsUiTest.kt

Notes: incremental pass over commits 0293919506 and aaf2820162. No new issues: the bulk-update deferral in PromptPanel is a coalesced one-shot invokeLater guarded by project.isDisposed (no listener or subscription leaks), the attachment-strip height now relies on JScrollPane.getPreferredSize() including the AS_NEEDED scrollbar once visible (self-correcting via revalidation), and the editor-context toggle's empty-ConfigPatchDto sentinel flows correctly through the draft/apply/reset state — the base is recomputed from the just-persisted PropertiesComponent value, so modified() clears after apply, and a failed remote save leaves the local pref unpersisted for retry. The one open suggestion above is carried from the previous pass and re-verified at HEAD (AttachmentChip still owns no background/outline paint, which also reaches assistant-message AttachmentView chips).

Fix these issues in Kilo Cloud

Previous review (commit 9ebe1f6)

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/attachment/AttachmentCard.kt 87 Removing AttachmentChip's background/outline painting also restyles AttachmentView chips on assistant messages, beyond the prompt-attachment scope named in the commit
Files Reviewed (14 files, incremental)
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionUi.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/context/EditorContextGatherer.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/context/KiloIgnore.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/context/KiloIgnoreCache.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/attachment/AttachmentCard.kt - 1 issue
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/style/SessionUiStyle.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/MessageView.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/PromptAttachmentView.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/settings/context/ContextSettingsUi.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/context/KiloIgnoreCacheTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/context/KiloIgnoreTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/views/MessageViewTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/views/PromptAttachmentViewTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/settings/context/ContextSettingsUiTest.kt

Notes: incremental pass over commits f66b7efc6c and 9ebe1f6bd4. All 6 previous findings are resolved in the new commits: the replacePart index now only falls back to the prompt wrap when the replaced view is nested inside it (covered by MessageViewTest), malformed ignore globs are skipped via runCatching, local() guards Path.of the same way rootDir() does, gather() runs after the slash-command/client-action branches, the new KiloIgnoreCache project service keeps the blocking VFS read off the repeat-prompt path with VFS-change invalidation, and the settings toggle's immediate-apply behavior is now documented and tested. Memory-leak check: the cache's message-bus connection is parented to the project service's own disposal and stores only compiled matchers keyed by URL string, so no VFS or listener leaks; chip mouse listeners remain self-contained. Tests exercise the real implementation via BasePlatformTestCase.

Fix these issues in Kilo Cloud

Previous review (commit 74470aa)

Status: 6 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 3
SUGGESTION 3
Issue Details (click to expand)

WARNING

File Line Issue
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/MessageView.kt 257 New || it === wrap in replacePart's position lookup never matches its intended case (existing is always a tool view) and instead inserts replaced tool views above the prompt bubble
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/context/KiloIgnore.kt 83 Unguarded Regex() on user-controlled ignore-file content — malformed globs (e.g. [], [z-a]) throw and break all prompt sends
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/context/KiloIgnore.kt 65 Blocking VFS read of ignore files on the EDT on every prompt; remote (cwm) reads in split mode can freeze the UI

SUGGESTION

File Line Issue
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionUi.kt 686 gather() runs before the client-action/server-command branches even though its result is discarded on those paths
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/context/EditorContextGatherer.kt 132 Path.of(file.path) in local() lacks the runCatching guard that rootDir() uses — cross-OS invalid filenames throw
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/settings/context/ContextSettingsUi.kt 138 New toggle writes immediately to PropertiesComponent, bypassing the page's draft/apply flow and backend-READY gating
Files Reviewed (35 files)
  • .changeset/jetbrains-auto-editor-context.md
  • .changeset/jetbrains-prompt-attachments.md
  • packages/kilo-jetbrains/.run/Run IDE (Backend).run.xml
  • packages/kilo-jetbrains/.run/Run IDE (Frontend).run.xml
  • packages/kilo-jetbrains/.run/runIdeSplitMode.run.xml
  • packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/cli/KiloCliDataParser.kt
  • packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/rpc/KiloWorkspaceRpcApiImpl.kt
  • packages/kilo-jetbrains/backend/src/test/kotlin/ai/kilocode/backend/cli/ChatLogSummaryTest.kt
  • packages/kilo-jetbrains/backend/src/test/kotlin/ai/kilocode/backend/cli/KiloCliDataParserTest.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/app/KiloWorkspaceService.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/plugin/KiloPluginSettings.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionFileLinks.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionUi.kt - 1 issue
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/context/EditorContextGatherer.kt - 1 issue
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/context/KiloIgnore.kt - 2 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/controller/SessionController.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/model/Message.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/model/SessionModel.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/attachment/AttachmentCard.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/style/SessionUiStyle.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/AttachmentView.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/MessageView.kt - 1 issue
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/PromptAttachmentView.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/settings/context/ContextSettingsUi.kt - 1 issue
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle.properties
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/SessionFileLinksTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/context/EditorContextGathererTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/context/KiloIgnoreTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/controller/EditorContextPromptTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/ui/SessionMessageListPanelTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/ui/SessionUiUpdateTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/testing/FakeWorkspaceRpcApi.kt
  • packages/kilo-jetbrains/shared/src/main/kotlin/ai/kilocode/log/ChatLogSummary.kt
  • packages/kilo-jetbrains/shared/src/main/kotlin/ai/kilocode/rpc/KiloWorkspaceRpcApi.kt
  • packages/kilo-jetbrains/shared/src/main/kotlin/ai/kilocode/rpc/dto/ChatDto.kt

Notes: incremental pass over the new prompt-attachments commit. The start/end query parsing in SessionModel.range(), the :line-end href round-trip through SessionFileLinks.parse, and the range-selection branch in navigate() all check out, including coercion of out-of-range lines. No new listeners, disposables, or cached resources introduced — chip mouse listeners are self-contained within each component, so no memory-leak concerns. Tests exercise the real implementation via BasePlatformTestCase. The 5 prior findings are unchanged (their files/lines were not touched by the new commits).

Fix these issues in Kilo Cloud

Previous review (commit 62923ad)

Status: 5 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 2
SUGGESTION 3
Issue Details (click to expand)

WARNING

File Line Issue
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/context/KiloIgnore.kt 83 Unguarded Regex() on user-controlled ignore-file content — malformed globs (e.g. [], [z-a]) throw and break all prompt sends
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/context/KiloIgnore.kt 65 Blocking VFS read of ignore files on the EDT on every prompt; remote (cwm) reads in split mode can freeze the UI

SUGGESTION

File Line Issue
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionUi.kt 686 gather() runs before the client-action/server-command branches even though its result is discarded on those paths
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/context/EditorContextGatherer.kt 132 Path.of(file.path) in local() lacks the runCatching guard that rootDir() uses — cross-OS invalid filenames throw
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/settings/context/ContextSettingsUi.kt 138 New toggle writes immediately to PropertiesComponent, bypassing the page's draft/apply flow and backend-READY gating
Files Reviewed (19 files)
  • .changeset/jetbrains-auto-editor-context.md
  • packages/kilo-jetbrains/.run/Run IDE (Backend).run.xml
  • packages/kilo-jetbrains/.run/Run IDE (Frontend).run.xml
  • packages/kilo-jetbrains/.run/runIdeSplitMode.run.xml
  • packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/cli/KiloCliDataParser.kt
  • packages/kilo-jetbrains/backend/src/test/kotlin/ai/kilocode/backend/cli/ChatLogSummaryTest.kt
  • packages/kilo-jetbrains/backend/src/test/kotlin/ai/kilocode/backend/cli/KiloCliDataParserTest.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/plugin/KiloPluginSettings.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionUi.kt - 1 issue
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/context/EditorContextGatherer.kt - 1 issue
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/context/KiloIgnore.kt - 2 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/controller/SessionController.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/settings/context/ContextSettingsUi.kt - 1 issue
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle.properties
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/context/EditorContextGathererTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/context/KiloIgnoreTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/controller/EditorContextPromptTest.kt
  • packages/kilo-jetbrains/shared/src/main/kotlin/ai/kilocode/log/ChatLogSummary.kt
  • packages/kilo-jetbrains/shared/src/main/kotlin/ai/kilocode/rpc/dto/ChatDto.kt

Notes: the EditorContextDto field set matches the CLI's MessageV2.EditorContext schema, the selection range URL (?start=&end=, 1-based) matches the CLI's prompt_async file-part handling, and the .kilocodeignore.gitignore + .env precedence mirrors the VS Code FileIgnoreController. Tests exercise the real implementation via BasePlatformTestCase; no mock or memory-leak concerns found (no new listeners, disposables, or cached resources).

Fix these issues in Kilo Cloud


Reviewed by kimi-k3 · Input: 65.9K · Output: 11.3K · Cached: 864.2K

Review guidance: REVIEW.md from base branch main

kirillk added 2 commits August 9, 2026 15:27
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.
@kirillk kirillk changed the title feat(jetbrains): add automatic editor context feat(jetbrains): add editor context and prompt attachments Aug 10, 2026
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.
@kirillk
kirillk merged commit 177fb5b into main Aug 10, 2026
24 checks passed
@kirillk
kirillk deleted the colossal-wizard branch August 10, 2026 20:12
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
feat(jetbrains): add editor context and prompt attachments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants