mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-19 10:02:04 +08:00
fix: Extension frozen on debug mode
This commit is contained in:
@@ -173,16 +173,13 @@ export class SdkSSEAdapter {
|
||||
|
||||
this.resetHeartbeat(attempt)
|
||||
|
||||
// The SDK yields GlobalEvent = { directory, payload: Event | SyncEvent* }.
|
||||
// We only forward the non-sync Event union; sync replay events are handled elsewhere.
|
||||
// The SDK yields GlobalEvent = { directory, payload: Event }.
|
||||
const globalEvent = event as GlobalEvent
|
||||
const payload = globalEvent.payload
|
||||
const type = (payload as { type: string }).type
|
||||
const type = (globalEvent.payload as { type: string }).type
|
||||
if (type !== "server.heartbeat") {
|
||||
console.log("[Kilo New] SSE: 📨 Event:", type)
|
||||
}
|
||||
if (type === "sync") continue
|
||||
this.notifyEvent(payload as Event)
|
||||
this.notifyEvent(globalEvent.payload as Event)
|
||||
}
|
||||
|
||||
console.log("[Kilo New] SSE: 📭 Stream ended normally")
|
||||
|
||||
@@ -67,7 +67,12 @@ export class ServerManager {
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log("[Kilo New] ServerManager: 🎬 Spawning CLI process:", cliPath, ["serve", "--port", "0"])
|
||||
const claudeCompat = vscode.workspace.getConfiguration("kilo-code.new").get<boolean>("claudeCodeCompat", false)
|
||||
// kilocode_change - pin cwd to a workspace folder (or $HOME) so the CLI doesn't inherit
|
||||
// the extension host's cwd, which is "/" under F5 debug and stalls cwd-dependent init.
|
||||
const spawnCwd =
|
||||
vscode.workspace.workspaceFolders?.[0]?.uri.fsPath ?? process.env.HOME ?? require("os").homedir()
|
||||
const serverProcess = spawn(cliPath, ["serve", "--port", "0"], {
|
||||
cwd: spawnCwd, // kilocode_change
|
||||
env: {
|
||||
...process.env,
|
||||
KILO_SERVER_PASSWORD: password,
|
||||
|
||||
Reference in New Issue
Block a user