Skip to content

feat(jetbrains): support queued prompts - #12571

Merged
kirillk merged 4 commits into
mainfrom
developing-liver
Jul 27, 2026
Merged

feat(jetbrains): support queued prompts#12571
kirillk merged 4 commits into
mainfrom
developing-liver

Conversation

@kirillk

@kirillk kirillk commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Issue

No linked issue; this is branch-scoped JetBrains queued-prompt work.

Context

Allow JetBrains users to submit another prompt while a session is busy. Queued prompts should be visible in the conversation and removable before they run.

Implementation

  • Parse and route session.queue.changed events from the CLI, including global message SSE events whose typed payload carries the event type.
  • Track queued message IDs in SessionModel and update session views when the queue changes.
  • Keep the send action available while busy when there is a draft, while preserving stop behavior when there is no draft.
  • Add a queued badge and remove action for queued user messages, backed by a new deleteMessage RPC call to the CLI message-delete endpoint.
  • Add a patch changeset for the JetBrains plugin.

Screenshots / Video

GIF Recording 2026-07-27 at 12 07 48 PM

How to Test

Manual/local verification

  • Agent ran ./gradlew typecheck from packages/kilo-jetbrains/: passed.
  • Agent ran ./gradlew test from packages/kilo-jetbrains/: passed.
  • Agent ran git diff --check origin/main...HEAD: passed.

Reviewer test steps

  1. Open the JetBrains plugin and start a session.
  2. Send a prompt that keeps the session busy.
  3. Type and send another prompt while the first turn is still running.
  4. Confirm the second prompt appears as queued with a remove action.
  5. Click the remove action and confirm the queued prompt is removed instead of being processed.

Blocked checks and substitute verification

  • None.

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

N/A

@kilo-code-bot

kilo-code-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Since the last review, the only change is commit da6d20a3 ("fix(jetbrains): localize queued prompt labels"), which adds the session.queued / session.queued.remove translated strings to the 18 locale KiloBundle_*.properties files. This is a pure localization addition with no logic changes; no issues found.

All 4 previously reported issues remain resolved:

  • Telemetry now fires only after deleteMessage confirms success (SessionController.kt).
  • The boolean result of deleteMessage is checked, with a Session Error telemetry event / warning log on a miss, and CancellationException correctly rethrown.
  • The permanent no-op view.setQueued(false) { ... } call was removed from TurnView.kt.
  • The unused setCustom/customButtons API was removed from MessageToolbar.kt.
Files Reviewed (18 files)
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_ar.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_bs.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_da.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_de.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_es.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_fr.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_ja.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_ko.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_nl.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_no.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_pl.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_pt_BR.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_ru.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_th.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_tr.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_uk.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_zh_CN.properties
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle_zh_TW.properties
Previous Review Summaries (2 snapshots, latest commit 0178e33)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 0178e33)

Status: No Issues Found | Recommendation: Merge

All 4 previously reported issues are resolved in this update:

  • Telemetry now fires only after deleteMessage confirms success (SessionController.kt).
  • The boolean result of deleteMessage is now checked and a Session Error telemetry event / warning log is emitted on a miss, with CancellationException correctly rethrown.
  • The permanent no-op view.setQueued(false) { ... } call was removed from TurnView.kt (queuing is handled via SessionMessageListPanel instead).
  • The unused setCustom/customButtons API was removed from MessageToolbar.kt.
  • New test coverage added for the delete-miss telemetry path (PromptLifecycleTest.kt).
Files Reviewed (4 files)
  • 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/views/MessageToolbar.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/views/TurnView.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/controller/PromptLifecycleTest.kt

Previous review (commit ec1e67b)

Status: 3 Issues Found | Recommendation: Address before merge

Overview

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

WARNING

File Line Issue
packages/kilo-jetbrains/frontend/.../controller/SessionController.kt 470 Telemetry for queued-message removal fires before the delete is confirmed, unlike the revert() pattern nearby
packages/kilo-jetbrains/frontend/.../controller/SessionController.kt 473 Boolean result of deleteMessage is discarded; delete failures are silently swallowed

SUGGESTION

File Line Issue
packages/kilo-jetbrains/frontend/.../views/TurnView.kt 70 view.setQueued(false) { ... } is a permanent no-op (called before wrap exists)
packages/kilo-jetbrains/frontend/.../views/MessageToolbar.kt 67 setCustom/customButtons added but never called anywhere
Files Reviewed (25 files)
  • .changeset/jetbrains-queued-prompts.md
  • packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/app/KiloBackendChatManager.kt
  • packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/cli/KiloCliDataParser.kt
  • packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/rpc/KiloSessionRpcApiImpl.kt
  • packages/kilo-jetbrains/backend/src/test/kotlin/ai/kilocode/backend/app/KiloBackendChatManagerTest.kt
  • packages/kilo-jetbrains/backend/src/test/kotlin/ai/kilocode/backend/cli/KiloCliDataParserTest.kt
  • packages/kilo-jetbrains/backend/src/test/kotlin/ai/kilocode/backend/testing/MockCliServer.kt
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/app/KiloSessionService.kt
  • 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 - 2 issues
  • 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/model/SessionModelEvent.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/ui/header/SessionHeaderPanel.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/views/MessageToolbar.kt - 1 issue
  • 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 - 1 issue
  • packages/kilo-jetbrains/frontend/src/main/resources/messages/KiloBundle.properties
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/controller/PromptLifecycleTest.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/SessionMessageListPanelTest.kt
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/testing/FakeSessionRpcApi.kt
  • packages/kilo-jetbrains/package.json
  • packages/kilo-jetbrains/shared/src/main/kotlin/ai/kilocode/log/ChatLogSummary.kt
  • packages/kilo-jetbrains/shared/src/main/kotlin/ai/kilocode/rpc/KiloSessionRpcApi.kt
  • packages/kilo-jetbrains/shared/src/main/kotlin/ai/kilocode/rpc/dto/ChatDto.kt

Fix these issues in Kilo Cloud


Reviewed by claude-sonnet-5 · Input: 36 · Output: 6.8K · Cached: 1.1M

Review guidance: REVIEW.md from base branch main

@kirillk
kirillk enabled auto-merge July 27, 2026 16:33
@johnnyeric

Copy link
Copy Markdown
Contributor

LGTM. Found 2 items in my review worth checking, ran some checks locally to verify if accurate.

P2: Attachment changes don't re-sync the send/stop button

syncButton() only runs from the document listener (PromptPanel.kt:277) and setBusy() (:422), but the icon now depends on hasDraft(), which includes attachments. addAttachment (:740) and removeAttachment (:748) only call syncEditorHeight() + onChange(), and onChange is just scroll.refresh() (SessionUi.kt:437).

Repro: while busy with an empty editor, add an attachment. The button still shows Stop, but the click handler recomputes hasDraft() (:215) and queues the attachment instead of stopping.

It doesn't recover on its own either. SessionState.Busy is a data class and setState dedupes on equality (SessionModel.kt:282), and nearly every call site builds Busy("considering"), so setBusy doesn't refire mid-turn. And the accidental send calls prompt.clear() (SessionUi.kt:678), which hits the same gap in reverse: editor.text = "" fires the listener while attachments is still populated so the icon goes to Send, then attachments.clear() runs with no re-sync. That leaves Send showing with no draft while busy, where isSendEnabled is false, so the button stops responding for the rest of the turn. alt S still works.

Adding syncButton() and syncTooltip() to attachment add/remove/clear fixed both cases locally. A test for the attachment-only + busy case would be a good guard.


Minor: queue state isn't rehydrated on session reopen

recoverPending() (SessionController.kt:1198) covers permissions, questions and status but not the queue, and there's no queue snapshot on the local /event SSE (the CLI only replays KiloSessionPromptQueue.snapshot() on the remote channel). So after switching away and back, the Queued badge and remove button disappear until the next queue event. The prompt still runs and the state converges on its own, so it's cosmetic. Just flagging it for later.

@kirillk
kirillk merged commit b42b87e into main Jul 27, 2026
22 of 23 checks passed
@kirillk
kirillk deleted the developing-liver branch July 27, 2026 18:21
@kirillk

kirillk commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

LGTM. Found 2 items in my review worth checking, ran some checks locally to verify if accurate.

P2: Attachment changes don't re-sync the send/stop button

syncButton() only runs from the document listener (PromptPanel.kt:277) and setBusy() (:422), but the icon now depends on hasDraft(), which includes attachments. addAttachment (:740) and removeAttachment (:748) only call syncEditorHeight() + onChange(), and onChange is just scroll.refresh() (SessionUi.kt:437).

Repro: while busy with an empty editor, add an attachment. The button still shows Stop, but the click handler recomputes hasDraft() (:215) and queues the attachment instead of stopping.

It doesn't recover on its own either. SessionState.Busy is a data class and setState dedupes on equality (SessionModel.kt:282), and nearly every call site builds Busy("considering"), so setBusy doesn't refire mid-turn. And the accidental send calls prompt.clear() (SessionUi.kt:678), which hits the same gap in reverse: editor.text = "" fires the listener while attachments is still populated so the icon goes to Send, then attachments.clear() runs with no re-sync. That leaves Send showing with no draft while busy, where isSendEnabled is false, so the button stops responding for the rest of the turn. alt S still works.

Adding syncButton() and syncTooltip() to attachment add/remove/clear fixed both cases locally. A test for the attachment-only + busy case would be a good guard.

Minor: queue state isn't rehydrated on session reopen

recoverPending() (SessionController.kt:1198) covers permissions, questions and status but not the queue, and there's no queue snapshot on the local /event SSE (the CLI only replays KiloSessionPromptQueue.snapshot() on the remote channel). So after switching away and back, the Queued badge and remove button disappear until the next queue event. The prompt still runs and the state converges on its own, so it's cosmetic. Just flagging it for later.

addressed here - 1a506a7

t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
feat(jetbrains): support queued prompts
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