Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/share-vscode-session-database.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---

Restore persisted sessions across development extension branches and worktrees.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export function resolveIndexingEnv(folders: readonly WorkspaceFolderLike[] | und
return { KILO_DISABLE_CODEBASE_INDEXING: "vscode-no-workspace" }
}

export function resolveManagedServerEnv(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv {
return { ...env, KILO_DISABLE_CHANNEL_DB: "true" }
}

export class ServerManager {
private instance: ServerInstance | null = null
private startupPromise: Promise<ServerInstance> | null = null
Expand Down Expand Up @@ -108,7 +112,7 @@ export class ServerManager {
NODE_USE_SYSTEM_CA: "1",
...(extraCaCerts && { NODE_EXTRA_CA_CERTS: extraCaCerts }),
...(!proxyStrictSSL && { NODE_TLS_REJECT_UNAUTHORIZED: "0" }),
...process.env,
...resolveManagedServerEnv(process.env),
// VS Code's http.proxy / http.noProxy settings are not reflected in
// process.env, so spawned children bypass the user's configured proxy
// and fail behind corporate firewalls. Forward them as the standard
Expand Down
14 changes: 13 additions & 1 deletion packages/kilo-vscode/tests/unit/server-manager-utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { describe, it, expect } from "bun:test"
import { parseServerPort } from "../../src/services/cli-backend/server-utils"
import { resolveServerCwd, resolveIndexingEnv, toErrorMessage } from "../../src/services/cli-backend/server-manager"
import {
resolveServerCwd,
resolveIndexingEnv,
resolveManagedServerEnv,
toErrorMessage,
} from "../../src/services/cli-backend/server-manager"
import {
copyTreeSitterResources,
resolveTreeSitterEnv,
Expand Down Expand Up @@ -177,4 +182,11 @@ describe("server workspace helpers", () => {
expect(resolveIndexingEnv([])).toEqual({ KILO_DISABLE_CODEBASE_INDEXING: "vscode-no-workspace" })
expect(resolveIndexingEnv([{ uri: { fsPath: "/repo" } }])).toEqual({})
})

it("uses the shared database for the managed backend while preserving the environment", () => {
expect(resolveManagedServerEnv({ PATH: "/usr/bin", KILO_DISABLE_CHANNEL_DB: "false" })).toEqual({
PATH: "/usr/bin",
KILO_DISABLE_CHANNEL_DB: "true",
})
})
})
Loading