Repository navigation
feat(jetbrains): add hosted Cloud sessions to Agent Manager - #15531
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Incremental review of
No new issues found on the changed lines. Note: validation commands were not run in this read-only review; findings are based on code inspection only. Files Reviewed (5 files)
Previous Review Summaries (4 snapshots, latest commit dd3df25)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit dd3df25)Status: 3 Issues Found | Recommendation: Address before merge Incremental review of Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (24 files)
Fix these issues in Kilo Cloud Previous review (commit cbbaeb8)Status: 17 Issues Found | Recommendation: Address before merge Incremental review of Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (44 incremental files)
Fix these issues in Kilo Cloud Previous review (commit 3fb7506)Status: 15 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (36 incremental files)
Previous review (commit a844bce)Status: 17 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)CRITICAL
WARNING
SUGGESTION
Files Reviewed (25 incremental + 6 targeted re-checks)
[Snapshot truncated.] Additional previous summary content was truncated to keep this comment within platform limits. Reviewed by deepseek-flash-latest · Input: 100.5K · Output: 18.3K · Cached: 970.9K Review guidance: REVIEW.md from base branch |
Preserve hosted snapshot boundaries and preparation revisions so reconnects do not leave tools running or hide wake progress. Share live workspace status across the editor and Agent Manager, using a single themed status badge.
Persist sanitized Cloud preparation failures, apply pending interaction corrections before the fence, and handle message terminal events without conflating them with session idle.
Cloud workspaces duplicated the worktree editor chrome, which drifted in layout, headers, session rows and list controls. Extract one retained editor base (panel, manager, header, row, visibility toggle) and build both backends on it so chat, date groups, badges and controls stay identical. Cloud discovery also stopped at ten pages and only mapped a legacy "running" compute status, so additional workspaces were hidden and a healthy workspace read as Unknown. Page through every workspace for the repository, map the canonical status vocabulary, keep mutable name/branch metadata out of the editor key (so a rename no longer forks the tab), and reuse the Marketplace Agents green for Active. Show busy Cloud sessions with the same spinner and attention icons as local worktrees, keep the compute badge in the header trailing group with a separate hourly price, label non-chat-ready workspaces Setting Up in grey, and expose Refresh from the row popup instead of the header.
Use the CLI built from this repository so plugin runs exercise local opencode changes instead of the published release. Production builds and release scripts reject this mode, so it stays a dedicated dev commit to be reverted before release.
Harden the hosted session lifecycle so retained streams survive attachment renewal and CLI reconnects, release attachments when their last owner leaves, and keep live status instead of resetting it. Load statuses progressively with generation guards, make watch retries bounded, and re-observe sessions after sign-in. Tighten Cloud UI behavior: gate compact actions, allow ordinary @tokens while rejecting real file mentions, guard queued Swing updates, bound the workspace metadata cache, and keep the releasable CLI pin. Reject session identities in workspace IDs, document the RPC contracts, and replace the combined changeset with one concise release note.
Bring in the latest CLI pin (7.8.22), the Kotlin/RPC plugin version guard, and the current main changes. Keep kilo.cli.pinned=true so the branch stays releasable and use main's newer CLI pin.
A CLI restart calls hosted.stop() while durable RPC collectors are still subscribed. Clearing continuity there orphaned those collectors, so their hosted tabs received no native events after start(). Preserve retained owners across stop, drop only transport-derived caches, and restore them against the replacement CLI. Keep full reset for genuine teardown. Also mark a transcript collector as retained only after retain() succeeds. retain() already decrements on attach failure or cancellation, so setting the flag first made the finally block release a second time and could cancel another live subscriber's stream.
SessionHost now reads kilo.session.inactive.disposeTimeoutMs whenever it schedules an inactive panel. Tests do not load the plugin's registryKey extensions, and only some side panel tests contributed the key, so the full suite failed with MissingResourceException once a test that did not register it disposed a panel. Contribute the key for every test in the class and keep only per-test value overrides.
Keep a transcript subscription alive when its first attachment fails transiently: retain now preserves the owner and lets restore() retry instead of throwing out of the RPC events flow, where SessionController would never resubscribe. Bound concurrent workspace status reads with a semaphore so large Cloud repositories cannot burst the CLI. Wire the full hosted reset into application shutdown so stop() (transport rebind) and true ownership teardown are distinct.
eshurakov
left a comment
There was a problem hiding this comment.
Bot - Minor: queued-message deletion is still offered for hosted sessions, but KiloSessionRpcApiImpl.deleteMessage rejects hosted ids via requireLocal (packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/rpc/KiloSessionRpcApiImpl.kt:226), so clicking a queued row's delete affordance silently does nothing (SessionController.deleteQueuedMessage only logs). Hide that affordance for hosted sessions, or route it through the hosted Session Host.
Task Board
This PR is part of the Kilo Task Board and implements task-board issue #8.
What Problem This Solves
JetBrains Agent Manager currently lists local worktrees but cannot discover or interact with live hosted Cloud sessions. Legacy Cloud history imports a local snapshot rather than continuing work in its hosted workspace. Reusing the local prompt payload also sends editor metadata that the current hosted native input contract rejects.
Why This Change Was Made
Keep Cloud authentication and transport inside the local CLI's Session Host, reuse the ordinary chat controller and transcript, and distinguish sessions by provider/workspace/native-session identity.
Changes:
7.8.21.The latest fix is
a844bce2f5. This remains a development implementation rather than a completed end-to-end acceptance claim: hosted streaming/reconciliation, stale authorization/deletion, attachment disposal on editor close, and live split-mode capability boundaries still need validation/hardening. Hosted file transfer and editor context are intentionally deferred; unsupported selected content is not silently sent without its files.User Impact
Users can discover existing Cloud workspaces automatically and use a text-only hosted chat surface without importing the session locally. The registered
kilo.cloudWorkspaces.enabledregistry key defaults on and allows opting out. Local worktrees retain editor context, selections, attachments, and reasoning settings. Workspace/session creation and destructive management are outside this change.Screenshots / Video
Pending live UI validation. The user explicitly approved publishing without media; no screenshot has been uploaded.
Evidence
./gradlew typecheck test --no-configuration-cachefrom the JetBrains package: passed. The full frontend suite executed; the separately passed full backend/shared results were reused../gradlew :backend:test --no-configuration-cache: passed, including realistic hosted prompt/command bodies, fail-before-network input validation, and structured system-feed parser regressions.bun test test/kilocode/server/hosted-routing.test.ts test/kilocode/server/session-host-httpapi.test.tsfrom the CLI package: passed, 37 tests.bun run script/check-opencode-annotations.ts --worktree,bun run script/check-md-table-padding.ts,bun run check-kilocode-changefrom the VS Code package, andgit diff --check: passed.KILO_BASIC_PROMPT_UNSUPPORTEDcaused by automatic editor context, plus object-valued status parser errors. Both paths now have regression coverage; a new live prompt has not been sent after these fixes.Dependency
Requires the hosted-workspace Session Host contract merged in #15509 and a released CLI containing it. The pin workflow validated
7.8.21, a published prerelease containing that contract. Stable-release/runtime compatibility must be confirmed before release. Current hosted native input remains text-only; deferred context/file producers are not prerequisites of this initial slice.