Skip to content

feat(jetbrains): add hosted Cloud sessions to Agent Manager - #15531

Merged
kirillk merged 11 commits into
mainfrom
feat/jetbrains-hosted-cloud-sessions
Oct 28, 2026
Merged

kirillk merged 11 commits into
mainfrom
feat/jetbrains-hosted-cloud-sessions

Conversation

@kirillk

@kirillk kirillk commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • Discover repository-scoped Cloud workspaces and paginated root sessions beside local worktrees by default, with passive compute/rate badges.
  • Open hosted workspace session lists and route supported history, text prompt, command, abort, question, permission, and diff requests through opaque local attachments.
  • Skip automatic local editor context and selections on hosted sends, reject files and file mentions visibly, restrict hosted models to Kilo, and omit unsupported reasoning variants. Validate rich input before attaching or sending; local input stays unchanged.
  • Decode structured Cloud preparation/sandbox events safely and retain composite event identities and reconnect resnapshot plumbing.
  • Add Core → Refresh Cloud for workspace/session lists and legacy Cloud History without restarting Core, and resolve Git remotes off the UI thread.
  • Disable local-only actions, add localized strings and a minor changeset, and update the CLI pin to 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.enabled registry 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

  • Agent ran ./gradlew typecheck test --no-configuration-cache from the JetBrains package: passed. The full frontend suite executed; the separately passed full backend/shared results were reused.
  • Agent ran ./gradlew :backend:test --no-configuration-cache: passed, including realistic hosted prompt/command bodies, fail-before-network input validation, and structured system-feed parser regressions.
  • Agent ran bun test test/kilocode/server/hosted-routing.test.ts test/kilocode/server/session-host-httpapi.test.ts from the CLI package: passed, 37 tests.
  • Agent ran bun run script/check-opencode-annotations.ts --worktree, bun run script/check-md-table-padding.ts, bun run check-kilocode-change from the VS Code package, and git diff --check: passed.
  • Normal pre-push monorepo typechecks passed, including JetBrains.
  • Live sandbox logs identified an HTTP 400 KILO_BASIC_PROMPT_UNSUPPORTED caused 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.
  • Plugin packaging/relaunch was not performed while the user's split sandbox was running, to avoid rewriting its loaded plugin files. Latest code requires a normal quit/relaunch for live validation.

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.

@github-actions github-actions Bot added area:agent-manager Agent Manager area:jetbrains JetBrains plugin labels Oct 28, 2026
@kirillk
kirillk marked this pull request as ready for review October 28, 2026 11:38
@kilo-code-bot

kilo-code-bot Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Incremental review of dd3df254..2ff3dd98 (5 files). All three findings from the previous review are resolved in current HEAD:

  • retain() no longer tears down the caller's live subscription on a transient attach failure; it keeps the retainer and lets restore() retry (covered by the new HostedStreamLifecycleTest case).
  • Workspace status reads are now bounded by Semaphore(8) and covered by a concurrency test.
  • The new KiloBackendHostedManager.close() is wired into KiloBackendAppService.shutdown(), so reset() now has a real teardown caller.

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)
  • packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/app/KiloBackendAppService.kt - 0 issues
  • packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/app/KiloBackendHostedManager.kt - 0 issues
  • packages/kilo-jetbrains/backend/src/test/kotlin/ai/kilocode/backend/app/HostedStreamLifecycleTest.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/app/KiloHostedService.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/app/KiloHostedServiceTest.kt - 0 issues
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 cbbaeb8d..dd3df254 (24 PR files); changes pulled in from the main merge in that range were excluded. The ownership/recovery rework, the progressive status refresh, the bounded editor cache, the panel re-observation, compact gating, and the file-mention validation all look sound on current HEAD. Three new items remain.

Overview

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

WARNING

File Line Issue
packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/rpc/KiloSessionRpcApiImpl.kt 376 events() now fails when the eager hosted.retain attach fails; the controller only logs and does not re-subscribe, and later attaches no longer start the native stream (retained == 0), so live transcript updates stay dead until reopen

SUGGESTION

File Line Issue
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/app/KiloHostedService.kt 399 Status refresh launches one concurrent read per discovered workspace with no concurrency cap
packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/app/KiloBackendHostedManager.kt 861 New reset() has no callers, yet stop()'s KDoc points at it for full teardown
Files Reviewed (24 files)
  • .changeset/jetbrains-hosted-cloud-sessions.md - 0 issues
  • .kilo/plans/8-jetbrains-hosted-cloud-sessions.md - deleted
  • packages/kilo-jetbrains/gradle.properties - 0 issues
  • packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/app/KiloBackendChatManager.kt - 0 issues
  • packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/app/KiloBackendHostedManager.kt - 1 issue
  • packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/rpc/KiloSessionRpcApiImpl.kt - 1 issue
  • packages/kilo-jetbrains/backend/src/test/kotlin/ai/kilocode/backend/app/HostedStreamLifecycleTest.kt - 0 issues
  • packages/kilo-jetbrains/backend/src/test/kotlin/ai/kilocode/backend/rpc/KiloHostedRoutingTest.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/AgentManagerPanel.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/hosted/HostedWorkspaceCache.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/hosted/HostedWorkspaceEditorPanel.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/app/KiloHostedService.kt - 1 issue
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionUi.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/header/SessionHeaderPanel.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/agentManager/hosted/HostedWorkspaceEditorPanelTest.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/agentManager/hosted/HostedWorkspaceRowTest.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/app/KiloHostedServiceTest.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/SessionSidePanelManagerTest.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/SessionUiEditorSelectionTest.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/test/kotlin/ai/kilocode/client/session/ui/header/SessionHeaderPanelTest.kt - 0 issues
  • packages/kilo-jetbrains/shared/src/main/kotlin/ai/kilocode/rpc/dto/ChatDto.kt - 0 issues
  • packages/kilo-jetbrains/shared/src/main/kotlin/ai/kilocode/rpc/dto/HostedDto.kt - 0 issues
  • packages/kilo-jetbrains/shared/src/main/kotlin/ai/kilocode/rpc/KiloHostedRpcApi.kt - 0 issues
  • packages/kilo-jetbrains/shared/src/test/kotlin/ai/kilocode/rpc/dto/HostedDtoTest.kt - 0 issues

Fix these issues in Kilo Cloud

Previous review (commit cbbaeb8)

Status: 17 Issues Found | Recommendation: Address before merge

Incremental review of 3fb7506a..cbbaeb8d (44 changed files): the Cloud/worktree chrome unification and the new "Refresh Cloud" row action look sound, and two earlier findings were fixed (detached preferredFocus, display name in editor params). Remaining items below are re-verified on current HEAD plus new findings from this increment.

Overview

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

WARNING

File Line Issue
packages/kilo-jetbrains/gradle.properties 6 kilo.cli.pinned=false makes the plugin non-releasable (production builds fail; the plan says the pin must stay pinned)
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/app/KiloHostedService.kt 199 One serial workspaceStatus RPC per workspace gates the first render, now over unbounded pagination
packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/app/KiloBackendHostedManager.kt 144 start() early-returns before applying a new client/port, so an error-recovery reconnect keeps the stale transport and attachment ids
packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/app/KiloBackendHostedManager.kt 560 Attachments keep both SSE loops for the CLI lifetime, and stop() sets started = false before close() so no detach is sent
packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/rpc/KiloSessionRpcApiImpl.kt 397 Throwing from savePermissionRules aborts the whole permission reply when an "always" rule is selected on a hosted session
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionUi.kt 1239 Only the slash command gates compact; the header compact button stays enabled for hosted sessions and hits backend requireLocal

SUGGESTION

File Line Issue
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/hosted/HostedWorkspaceEditorKind.kt 37 Editor title reads an EDT-only mutableMapOf cache from VirtualFile.getName()/presentableUrl (possible any thread); the app-level cache also never evicts
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/hosted/HostedWorkspaceEditorPanel.kt 203 After sign-out/gate-off drops the observation, sync() never re-observes the still-current session, so its system feed stays dead
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/app/KiloHostedService.kt 379 Watch retry loop keeps a fixed 1s delay and warns on every attempt for up to 50 sessions; no backoff
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/AgentManagerPanel.kt 212 invokeLater state update is not guarded against disposal
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionUi.kt 1084 promptMentions matches any standalone @token, so hosted prose such as @Override is rejected as an unsupported file mention
packages/kilo-jetbrains/shared/src/main/kotlin/ai/kilocode/rpc/dto/ChatDto.kt 340 New KDoc leaves SessionInterrupted undocumented
packages/kilo-jetbrains/shared/src/main/kotlin/ai/kilocode/rpc/dto/HostedDto.kt 28 parseWorkspace accepts session identities, breaking the isWorkspace discriminator
packages/kilo-jetbrains/shared/src/main/kotlin/ai/kilocode/rpc/KiloHostedRpcApi.kt 42 systemEvents parameter is the native session id but the KDoc does not say so
packages/kilo-jetbrains/backend/src/test/kotlin/ai/kilocode/backend/rpc/KiloHostedRoutingTest.kt 262 Publish races the event subscriber; status test can time out
.kilo/plans/8-jetbrains-hosted-cloud-sessions.md 1 Scratch plan file committed; AGENTS.md says not to include .kilo/plans/** and the plan itself says to omit it
.changeset/jetbrains-hosted-cloud-sessions.md 11 Changeset is written as implementation notes; rewrite as user-facing release notes
Files Reviewed (44 incremental files)
  • .changeset/jetbrains-hosted-cloud-sessions.md - 1 issue
  • .kilo/plans/8-jetbrains-hosted-cloud-sessions.md - 1 issue
  • packages/kilo-jetbrains/gradle.properties - 1 issue
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/app/KiloHostedService.kt - 2 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/AgentManagerPanel.kt - 1 issue
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/WorkspaceSessionEditorPanel.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/WorkspaceSessionEditorManager.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/WorkspaceSessionHeader.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/WorkspaceSessionListToggle.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/WorkspaceSessionRow.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/hosted/* (Cache, DataKeys, EditorKind, EditorManager, EditorPanel, Icons, Row, Status, Title) - 2 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/worktree/* (Activity, PrHeaderView, SessionEditorManager, SessionEditorPanel) - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/actions/OpenConfigActions.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/actions/RefreshHostedWorkspaceAction.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/history/HistoryItem.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/header/PrHeaderView.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/ui/list/* (ActiveListMenu, ActiveListModel, ActiveListRenderer) - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/resources/* (icons, plugin XML, bundle) - 0 issues
  • Frontend tests (10 files: actions, panel, toggle, hosted panel/row, PR header, worktree panel, hosted service, list menu) - reviewed, no new issues
  • Previously reviewed backend/shared files (hosted manager, session RPC, SessionUi, ChatDto, HostedDto, hosted RPC, routing test) - targeted re-verification only

Fix these issues in Kilo Cloud

Previous review (commit 3fb7506)

Status: 15 Issues Found | Recommendation: Address before merge

Overview

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

WARNING

File Line Issue
packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/app/KiloBackendHostedManager.kt 144 start() early-returns before applying a new client/port, so an error-recovery reconnect keeps the stale transport and attachment ids
packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/app/KiloBackendHostedManager.kt 560 Retained attachments keep both SSE loops for the CLI lifetime; stop() also sets started = false before close(), so no detach is ever sent
packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/rpc/KiloSessionRpcApiImpl.kt 397 Throwing from savePermissionRules aborts the whole permission reply when an "always" rule is selected
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/app/KiloHostedService.kt 187 Sequential per-workspace status RPCs gate the first render of the workspace list
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionUi.kt 1239 Only the slash command gates compact; the header compact button stays enabled for hosted sessions

SUGGESTION

File Line Issue
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/hosted/HostedWorkspaceEditorPanel.kt 200 After sign-out/gate-off drops the observation, sync() never re-opens the still-current session, so its system feed stays dead
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/app/KiloHostedService.kt 355 Watch retry loop keeps a fixed 1s delay and warns on every attempt for up to 50 sessions; no backoff
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/hosted/HostedWorkspaceEditorPanel.kt 141 preferredFocus() returns the manager's detached component, so focus never lands
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/hosted/HostedWorkspaceEditorKind.kt 92 Display name in editor params can open a duplicate tab for the same workspace
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/AgentManagerPanel.kt 196 invokeLater state update is not guarded against disposal
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionUi.kt 1084 promptMentions matches any standalone @token, so hosted text containing @Override or an @handle is rejected as an unsupported file mention
packages/kilo-jetbrains/shared/src/main/kotlin/ai/kilocode/rpc/dto/ChatDto.kt 340 New KDoc leaves SessionInterrupted undocumented
packages/kilo-jetbrains/shared/src/main/kotlin/ai/kilocode/rpc/dto/HostedDto.kt 28 parseWorkspace accepts session identities, breaking the isWorkspace discriminator
packages/kilo-jetbrains/shared/src/main/kotlin/ai/kilocode/rpc/KiloHostedRpcApi.kt 42 systemEvents parameter is the native session id but the KDoc does not say so
packages/kilo-jetbrains/backend/src/test/kotlin/ai/kilocode/backend/rpc/KiloHostedRoutingTest.kt 262 Publish races the event subscriber; status test can time out
Files Reviewed (36 incremental files)
  • .changeset/jetbrains-hosted-cloud-sessions.md - 0 issues
  • packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/app/KiloBackendHostedManager.kt - 2 issues
  • packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/app/HostedSystemEventParser.kt - 0 issues
  • packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/cli/KiloCliDataParser.kt - 0 issues
  • packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/rpc/KiloSessionRpcApiImpl.kt - 1 issue
  • packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/app/KiloBackendChatManager.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/app/KiloHostedService.kt - 2 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/hosted/HostedWorkspaceEditorPanel.kt - 2 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/hosted/HostedWorkspaceEditorManager.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/hosted/HostedWorkspaceRow.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/AgentManagerPanel.kt - 1 issue
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/controller/SessionController.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/controller/SessionUpdateQueue.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/model/SessionModel.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/ProgressPanel.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/SessionMessageListPanel.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionUi.kt - 2 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionHost.kt - 0 issues
  • packages/kilo-jetbrains/shared/src/main/kotlin/ai/kilocode/rpc/dto/ChatDto.kt - 1 issue
  • packages/kilo-jetbrains/shared/src/main/kotlin/ai/kilocode/rpc/dto/HostedDto.kt - 1 issue
  • packages/kilo-jetbrains/shared/src/main/kotlin/ai/kilocode/rpc/KiloHostedRpcApi.kt - 1 issue
  • packages/kilo-jetbrains/backend/src/test/kotlin/ai/kilocode/backend/testing/MockCliServer.kt - 0 issues
  • Additional test files (parser, stream lifecycle, hosted routing, panel, service, recovery) - reviewed, no new issues

Previous review (commit a844bce)

Status: 17 Issues Found | Recommendation: Address before merge

Overview

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

CRITICAL

File Line Issue
packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/app/KiloBackendHostedManager.kt 524 Renewal from eventLoop calls ensure(), whose close(existing) cancels the calling stream job; the reattach never completes, leaving dead streams until another RPC triggers ensure()
packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/app/KiloBackendHostedManager.kt 434 (same defect, close(existing) inside ensure())

WARNING

File Line Issue
packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/app/KiloBackendHostedManager.kt 125 start() early-returns before applying a new client/port, so an error-recovery reconnect can keep the old transport and attachment ids
packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/app/KiloBackendHostedManager.kt 161 Attachments and their two SSE loops are never released when the editor closes; stop() also skips detach
packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/app/KiloBackendHostedManager.kt 597 Reattaching clears the session's status, so a busy hosted session flips to idle on every renewal
packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/rpc/KiloSessionRpcApiImpl.kt 397 Throwing from savePermissionRules aborts the whole permission reply when an "always" rule is selected
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/app/KiloHostedService.kt 128 Sequential per-workspace status RPCs gate the first render of the workspace list
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/hosted/HostedWorkspaceEditorPanel.kt 66 preparation label is never added to the UI, so system/preparation status is invisible
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionUi.kt 1224 Only the slash command gates compact; the header compact button still calls controller.compact() and fails for hosted

SUGGESTION

File Line Issue
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/hosted/HostedWorkspaceEditorPanel.kt 107 The header Refresh link calls refresh() and then reload() directly, so the new refreshes collector triggers a second concurrent reload per click
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionUi.kt 1063 promptMentions matches any standalone @token, so hosted text containing @Override or an @handle is rejected as an unsupported file mention
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/hosted/HostedWorkspaceEditorKind.kt 92 Display name in editor params can open a duplicate tab for the same workspace
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/hosted/HostedWorkspaceEditorPanel.kt 126 preferredFocus() returns the manager's detached component, so focus never lands
packages/kilo-jetbrains/shared/src/main/kotlin/ai/kilocode/rpc/dto/ChatDto.kt 329 New KDoc leaves SessionInterrupted undocumented
packages/kilo-jetbrains/shared/src/main/kotlin/ai/kilocode/rpc/dto/HostedDto.kt 28 parseWorkspace accepts session identities, breaking the isWorkspace discriminator
packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/AgentManagerPanel.kt 196 invokeLater state update is not guarded against disposal
packages/kilo-jetbrains/shared/src/main/kotlin/ai/kilocode/rpc/KiloHostedRpcApi.kt 42 systemEvents parameter is the native session id but the KDoc doesn't say so
packages/kilo-jetbrains/backend/src/test/kotlin/ai/kilocode/backend/rpc/KiloHostedRoutingTest.kt 262 Publish races the event subscriber; status test can time out
Files Reviewed (25 incremental + 6 targeted re-checks)
  • .changeset/jetbrains-hosted-cloud-sessions.md - 0 issues
  • packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/app/HostedSystemEventParser.kt - 0 issues
  • packages/kilo-jetbrains/backend/src/main/kotlin/ai/kilocode/backend/app/KiloBackendHostedManager.kt - 4 issues
  • packages/kilo-jetbrains/backend/src/test/kotlin/ai/kilocode/backend/app/HostedSystemEventParserTest.kt - 0 issues
  • packages/kilo-jetbrains/backend/src/test/kotlin/ai/kilocode/backend/rpc/KiloHostedRoutingTest.kt - 1 issue
  • packages/kilo-jetbrains/backend/src/test/kotlin/ai/kilocode/backend/testing/MockCliServer.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/actions/RefreshCloudAction.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/agentManager/hosted/HostedWorkspaceEditorPanel.kt - 3 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/app/KiloHostedService.kt - 1 issue
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionSidePanelManager.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/SessionUi.kt - 2 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/controller/SessionController.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/history/HistoryController.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/prompt/KiloPromptCompletionProvider.kt - 0 issues
  • packages/kilo-jetbrains/frontend/src/main/kotlin/ai/kilocode/client/session/ui/prompt/PromptPanel.kt - 0 issues
  • `packages/kilo-jetbrains/frontend/src/main/resource

[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 main

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.
@kirillk
kirillk merged commit a0099d7 into main Oct 28, 2026
25 checks passed
@kirillk
kirillk deleted the feat/jetbrains-hosted-cloud-sessions branch October 28, 2026 19:20

@eshurakov eshurakov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent-manager Agent Manager area:jetbrains JetBrains plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants