mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-21 05:52:35 +08:00
fix(cli): avoid indexing plugin blocking startup
This commit is contained in:
@@ -6,6 +6,9 @@ import { hasIndexingPlugin } from "@kilocode/kilo-indexing/detect"
|
||||
import { Account } from "../../../src/account/account"
|
||||
import { Auth } from "../../../src/auth"
|
||||
import { Config } from "../../../src/config/config"
|
||||
import type { ConfigPlugin } from "../../../src/config/plugin"
|
||||
import { KilocodeDefaultPlugins } from "../../../src/kilocode/config/default-plugins"
|
||||
import { INDEXING_PLUGIN } from "../../../src/kilocode/indexing-feature"
|
||||
import * as CrossSpawnSpawner from "@opencode-ai/core/cross-spawn-spawner"
|
||||
import { Env } from "../../../src/env"
|
||||
import { AppFileSystem } from "@opencode-ai/core/filesystem"
|
||||
@@ -50,6 +53,28 @@ describe("kilocode default indexing plugin", () => {
|
||||
await disposeAllInstances()
|
||||
})
|
||||
|
||||
test("injects indexing without registering an external plugin origin", () => {
|
||||
const config: { plugin?: ConfigPlugin.Spec[]; plugin_origins?: ConfigPlugin.Origin[] } = {}
|
||||
|
||||
KilocodeDefaultPlugins.apply(config, { disabled: false })
|
||||
|
||||
expect(hasIndexingPlugin(config.plugin ?? [])).toBe(true)
|
||||
expect(config.plugin_origins).toBeUndefined()
|
||||
})
|
||||
|
||||
test("removes a persisted indexing marker from external plugin origins", () => {
|
||||
const external: ConfigPlugin.Origin = { spec: "global-plugin", source: "global", scope: "global" }
|
||||
const config = {
|
||||
plugin: [INDEXING_PLUGIN, external.spec],
|
||||
plugin_origins: [{ spec: INDEXING_PLUGIN, source: "global", scope: "global" as const }, external],
|
||||
}
|
||||
|
||||
KilocodeDefaultPlugins.apply(config, { disabled: true })
|
||||
|
||||
expect(config.plugin).toEqual([INDEXING_PLUGIN, external.spec])
|
||||
expect(config.plugin_origins).toEqual([external])
|
||||
})
|
||||
|
||||
test("does not hard-enable indexing plugin when default plugins are disabled", async () => {
|
||||
const prev = process.env["KILO_DISABLE_DEFAULT_PLUGINS"]
|
||||
process.env["KILO_DISABLE_DEFAULT_PLUGINS"] = "true"
|
||||
|
||||
Reference in New Issue
Block a user