test(cli): adapt upstream plugin fixture for Kilo

This commit is contained in:
Alex Alecu
2026-04-28 10:50:36 +03:00
parent fb9dc874d5
commit 7d9a4f3316
@@ -56,13 +56,15 @@ async function defaultModel() {
return run((provider) => provider.defaultModel())
}
// kilocode_change start - upstream #24416 fixture adapted for @kilocode/plugin
async function markPluginDependenciesReady(dir: string) {
await mkdir(path.join(dir, "node_modules"), { recursive: true })
await Bun.write(
path.join(dir, "package-lock.json"),
JSON.stringify({ packages: { "": { dependencies: { "@opencode-ai/plugin": "0.0.0" } } } }),
JSON.stringify({ packages: { "": { dependencies: { "@kilocode/plugin": "0.0.0" } } } }),
)
}
// kilocode_change end
function paid(providers: Awaited<ReturnType<typeof list>>) {
const item = providers[ProviderID.make("opencode")]
@@ -2492,11 +2494,13 @@ test("cloudflare-ai-gateway forwards config metadata options", async () => {
test("plugin config providers persist after instance dispose", async () => {
await using tmp = await tmpdir({
init: async (dir) => {
// kilocode_change start - upstream #24416 avoids real plugin dependency installs
const configDir = path.join(dir, ".opencode")
const root = path.join(configDir, "plugin")
await mkdir(root, { recursive: true })
await markPluginDependenciesReady(configDir)
await markPluginDependenciesReady(Global.Path.config)
// kilocode_change end
await Bun.write(
path.join(root, "demo-provider.ts"),
[