Skip to content

feat(jetbrains): support prompt and transcript attachments - #11077

Merged
kirillk merged 25 commits into
mainfrom
balanced-backpack
Jun 15, 2026
Merged

feat(jetbrains): support prompt and transcript attachments#11077
kirillk merged 25 commits into
mainfrom
balanced-backpack

Conversation

@kirillk

@kirillk kirillk commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Issue

No linked issue. This is a JetBrains attachment UX follow-up branch.

Context

This adds first-class prompt and transcript attachment support to the JetBrains plugin so users can attach files/images, see those attachments in chat, and reopen embedded transcript attachments in Kilo-owned editor tabs.

Features introduced in this PR:

  • Paste image/file attachments into the JetBrains prompt.
  • Drop files into the JetBrains prompt.
  • Show selected prompt attachments as compact cards before sending.
  • Gate media attachments based on the selected model capability.
  • Send prompt attachments through the shared chat DTO/session model path.
  • Render transcript file parts as attachment cards.
  • Route file: transcript attachments to normal workspace file opening.
  • Route external URL attachments to the browser.
  • Open embedded data: transcript attachments in Kilo editor tabs.
  • Keep duplicate file parts with the same partId distinct by matching/opening with an attachment key.
  • Show attachment editor loading, CLI connection retry, missing attachment, text, image, and binary metadata states.
  • Add a reusable project-neutral Kilo VFS foundation for future Kilo virtual editor kinds.

Implementation

Prompt attachments flow through the shared chat DTOs and session model, with prompt paste/drop handling, attachment cards, and model capability gating.

Transcript file parts render as attachment cards. Attachment clicks preserve the existing routing behavior for blank URLs, invalid URLs, file: URLs, and browser URLs. Embedded data: attachments now open through a frontend-managed kilo:// virtual filesystem instead of writing physical .kiloattachment descriptor files through backend RPC.

The VFS compromise for this iteration is intentional: Kilo VFS identity is project-neutral and stable for de-duping tabs, but attachment tabs are not added to Recent Files and are not persisted across IDE restarts. That avoids stale launch-local/session-local attachment entries while preserving a reusable VFS/editor abstraction for future Kilo virtual file kinds.

The attachment editor remains independent from SessionUi: SessionUi only opens a Kilo virtual file with self-describing params, while the editor owns CLI connection, retry UI, message lookup, attachmentKey matching, and rendering. Backend descriptor-file handoff and backend placeholder editor registration were removed.

Screenshots / Video

DnD to the prompt

GIF Recording 2026-06-14 at 9 32 49 PM

Open from the session

GIF Recording 2026-06-14 at 9 33 37 PM

How to Test

Manual/local verification

  • Agent: ./gradlew :frontend:test --tests "ai.kilocode.client.session.ui.attachment.AttachmentEditorKindTest" --tests "ai.kilocode.client.app.KiloWorkspaceServiceTest" from packages/kilo-jetbrains/ passed.
  • Agent: ./gradlew typecheck from packages/kilo-jetbrains/ passed.
  • Agent/pre-push: bun turbo typecheck from repo root passed during git push.

Reviewer test steps

  1. Launch the JetBrains plugin sandbox.
  2. Paste or drop an image/file into the prompt and confirm it appears as an attachment card.
  3. Switch between a model with attachment support and one without attachment support and confirm the prompt attachment affordance follows capability state.
  4. Send a prompt with an attachment and confirm the transcript renders the attachment card.
  5. Click a file: transcript attachment and confirm it opens the workspace file.
  6. Click an external URL transcript attachment and confirm it opens in the browser.
  7. Click an embedded transcript attachment and confirm it opens in a Kilo editor tab with loading/connection states.
  8. Open the same embedded attachment again and confirm the existing editor tab is reused.
  9. Open two embedded attachments that share the same partId but have different content and confirm they open as distinct Kilo tabs.
  10. Restart the IDE and confirm embedded Kilo attachment tabs are not restored from editor history.

Blocked checks and substitute verification

  • No blocked checks.

Checklist

  • Issue linked above, or exception explained
  • Tests/verification described
  • Screenshots/video included for visual changes, or marked N/A
  • Changeset considered for user-facing changes
  • I personally reviewed the diff and can explain the changes, including any AI-assisted work.

Get in Touch

kirillk added 22 commits June 8, 2026 14:52
# Conflicts:
#	packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionUi.kt
#	packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/SessionMessageListPanel.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/TurnView.kt
#	packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/ViewFactory.kt
# Conflicts:
#	packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionUi.kt
#	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/ui/SessionMessageListPanel.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/TurnView.kt
#	packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/ViewFactory.kt
#	packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle.properties
#	packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/ui/PromptPanelTest.kt
…-backpack

# Conflicts:
#	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/ViewFactory.kt
#	packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/ui/SessionUiUpdateTest.kt
# Conflicts:
#	packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/controller/SessionController.kt
#	packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle.properties
#	packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/ui/PromptPanelTest.kt
…-backpack

# Conflicts:
#	packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionUi.kt
#	packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/controller/SessionController.kt
#	packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle.properties
#	packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/ui/PromptPanelTest.kt
@kirillk
kirillk marked this pull request as ready for review June 14, 2026 19:55
@kilo-code-bot

kilo-code-bot Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Previously Flagged Issues — Now Resolved
File Issue
PromptAttachment.kt WARNING (resolved): Blocking I/O on EDT — part() / path.readBytes() is now called from a pooled thread in the new async submit() flow
KiloCliParser.kt SUGGESTION (resolved): Regex recompiled on every tag() call — fixed by caching compiled patterns in a ConcurrentHashMap
Files Reviewed (4 changed files)
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/prompt/PromptPanel.kt — resolved previous EDT blocking I/O warning; submit() now correctly offloads part() to a pooled thread, guards against double-submit with a submitting flag, and returns to EDT for UI mutation with lifecycle checks
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/ui/PromptPanelTest.kt — test helpers updated to wait for async submit
  • packages/kilo-jetbrains/shared/src/main/kotlin/ai/kilocode/cli/KiloCliParser.kt — resolved previous regex-per-call suggestion
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle.properties — new error message key added

Fix these issues in Kilo Cloud


Reviewed by claude-4.6-sonnet-20260217 · 739,956 tokens

Review guidance: REVIEW.md from base branch main

Comment thread packages/kilo-jetbrains/shared/src/main/kotlin/ai/kilocode/cli/KiloCliParser.kt Outdated
return URLDecoder.decode(raw, StandardCharsets.UTF_8)
}
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the attachment icons not be closer to the once we have in vscode?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you pls clarify, I'm not sure I'm getting this. I will merge this one since there're other PRs piling and and will address it there.

@kirillk
kirillk merged commit 533323f into main Jun 15, 2026
20 checks passed
@kirillk
kirillk deleted the balanced-backpack branch June 15, 2026 15:06
LigiaZ added a commit that referenced this pull request Jun 15, 2026
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
feat(jetbrains): support prompt and transcript 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