mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-08-30 17:14:40 +08:00
fix(cli): avoid narrow shutdown runtime load
This commit is contained in:
@@ -19,6 +19,10 @@ export function hasLazyCommandSelection() {
|
||||
return selected
|
||||
}
|
||||
|
||||
export function resetLazyCommandSelection() {
|
||||
selected = false
|
||||
}
|
||||
|
||||
export function markLazyCommandSelection() {
|
||||
selected = true
|
||||
}
|
||||
|
||||
@@ -153,6 +153,7 @@ export namespace KiloCli {
|
||||
if (narrow) {
|
||||
const { KiloCliBootstrapRuntime } = await import("@/kilocode/cli/bootstrap-runtime")
|
||||
await KiloCliBootstrapRuntime.dispose()
|
||||
return
|
||||
}
|
||||
const { InstanceRuntime } = await import("@/project/instance-runtime")
|
||||
await InstanceRuntime.disposeAllInstances() // safety net (no-op if already disposed)
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
import { describe, expect, test } from "bun:test"
|
||||
import { afterEach, beforeEach, describe, expect, test } from "bun:test"
|
||||
import { KiloCli } from "../../../src/kilocode/cli/setup"
|
||||
import { createHelpCommand } from "../../../src/kilocode/help-command"
|
||||
import { resetLazyCommandSelection } from "../../../src/kilocode/cli/lazy-commands"
|
||||
import yargs from "yargs"
|
||||
|
||||
describe("CLI bootstrap runtime selection", () => {
|
||||
beforeEach(resetLazyCommandSelection)
|
||||
afterEach(resetLazyCommandSelection)
|
||||
|
||||
test("uses the narrow runtime for worker-backed TUI launches", () => {
|
||||
expect(KiloCli.workerTui({ _: [] })).toBe(true)
|
||||
expect(KiloCli.workerTui({ _: ["./project"] })).toBe(true)
|
||||
|
||||
Reference in New Issue
Block a user