fix(vscode): restore shared session database

This commit is contained in:
marius-kilocode
2026-06-10 18:45:01 +02:00
parent 5d04b253b3
commit 5969a4c210
3 changed files with 23 additions and 2 deletions
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---
Restore persisted sessions across development extension branches and worktrees.
@@ -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
@@ -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
@@ -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,
@@ -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",
})
})
})