Repository navigation
Conversation
Discover, open, start, and interact with Kilo Cloud hosted sessions through the local Kilo backend instead of talking to Cloud directly. Hosted sessions use a namespaced host:<provider>:<session> key and one attachment registry, so colliding native session ids never cross-route. Durable reads use the session-host transcript surface and never attach, while live work attaches lazily, retries once on a recoverable attachment failure, and re-snapshots when continuity cannot be proven. The feature is gated by kilo-code.new.experimental.hostedSessions.
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (3 files)
Fix these issues in Kilo Cloud Previous Review Summaries (2 snapshots, latest commit cc12454)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit cc12454)Status: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (11 files)
Fix these issues in Kilo Cloud Previous review (commit 8bab99c)Status: 7 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)CRITICAL
WARNING
SUGGESTION
Files Reviewed (52 files)
Reviewed by deepseek-flash-latest · Input: 56K · Output: 12K · Cached: 955.4K Review guidance: REVIEW.md from base branch |
Clear the stale cloud preview when a hosted session is selected so prompts cannot be routed to a previously previewed cloud session, and keep the preview fallback off hosted keys entirely. Move the hosted panel out of the tab list so it renders in the history body, release hosted subscriptions when a session is no longer open, and detach an attachment that lost the invalidation race instead of leaking it. A late hosted load no longer steals focus or clears another session's loading state, and provider/session discovery errors are surfaced with a retry.
Keep opened hosted tabs through local session reconciliation and track provider and session discovery failures independently so one successful response cannot hide the other request's error.
| setCloud(undefined) | ||
| // Complete local session lists never contain hosted keys. Preserve this | ||
| // tab until the user closes it instead of reconciling it away. | ||
| fresh.add(id) |
There was a problem hiding this comment.
WARNING: This only preserves hosted tabs opened in the current webview context, so a restored hosted tab is still reconciled away.
persist() writes hosted keys into sidebarSessionTabIDs and restoreTabs brings them back on the next webview start (for example after hiding and re-showing the sidebar), but fresh starts empty and nothing re-seeds it for restored ids. The connect effect then calls session.loadSessions() whenever real() is non-empty, and tabsForLoadedSessions keeps only ids present in the response, preserveSessionIds, or fresh. Hosted keys are in none of those, so the restored hosted tab is removed and focus(next.active) switches the user to another session - the same failure this change fixes for freshly opened tabs. Consider seeding fresh from the restored hosted ids (or having reconcileTabs skip host: ids).
Task Board
Part of the Kilo Task Board: https://github.com/Kilo-Org/kilo-taskboard/issues/6
Problem
The CLI now exposes a provider-neutral session-host surface for Kilo Cloud hosted sessions, but VS Code had no way to discover, start, or work with them. Any future attempt to add one by talking to Cloud directly would duplicate transport and auth, bypass local routing, and risk mixing a provider's native session ids with local ids.
What changed
Adds an experimental hosted-session experience to the VS Code extension, gated by
kilo-code.new.experimental.hostedSessions.src/hosted/): namespacedhost:<provider>:<session>view keys, a per-provider attachment registry that coalesces attaches, one-shot re-attach on recoverable attachment failures, and fence/resnapshot-aware stream framing.sessionHost.providers/sessionHost.list, a start flow that always sends an operation key plus message id for retry safety, and durable open throughsessionHost.get/sessionHost.transcript.Continue in Worktree) and the single-message diff read are suppressed for hosted sessions.cloud:import preview, so colliding native ids from different providers cannot cross-route tabs, events, or answers.Verification
From
packages/kilo-vscode/:bun run typecheck— passedbun run lint— passedbun run compile— passedbun run knip— passedbun run check-kilocode-change— passedbun test tests/unit/hosted-identity.test.ts tests/unit/hosted-core.test.ts tests/unit/hosted-service.test.ts— 18 passedbun run test:unit— 6982 passed, 2 failed. Both failures are intests/unit/worktree-pool.test.ts(git/worktree timing under the sandbox) and reproduce when that file runs alone; it imports onlyWorktreeManager, which this PR does not touch.New tests cover: key parsing and provider collisions, attachment coalescing and invalidation,
Error.causefailure parsing, resnapshot/fence classification, retagging, durable open issuing zero attach/event calls, prompt routing through the attachment selector, one-shot re-attach on a recoverable failure, no retry on an unrecoverable one, and start idempotency fields.The end-to-end Cloud behavior matrix requires a signed-in account against deployed Cloud M1 and was not exercised here.
Scope
Confined to
packages/kilo-vscode/plus a changeset. No CLI or Cloud changes.