From 2e0c6e8f5e2d836aa5468a2a38d6b311d99a0c87 Mon Sep 17 00:00:00 2001 From: Rodaddy Date: Sat, 27 Jun 2026 02:49:10 -0400 Subject: [PATCH] fix: preserve local bootstrap services on import --- src/config/loader.ts | 1 + tests/config/loader.test.ts | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/config/loader.ts b/src/config/loader.ts index eeaf72f..09a485f 100644 --- a/src/config/loader.ts +++ b/src/config/loader.ts @@ -320,6 +320,7 @@ export function mergeImportedConfig( const services: ServicesConfig["services"] = structuredClone(localConfig.services); for (const [name, importedService] of Object.entries(importedConfig.services)) { + if (services[name]) continue; services[name] = structuredClone(importedService); services[name].source = importedService.source ?? "remote"; } diff --git a/tests/config/loader.test.ts b/tests/config/loader.test.ts index ec85ba2..7ea80d0 100644 --- a/tests/config/loader.test.ts +++ b/tests/config/loader.test.ts @@ -534,7 +534,7 @@ describe("loadConfig", () => { }); describe("mergeImportedConfig", () => { - test("imported service wins and source comes from imported config", () => { + test("local bootstrap service wins over imported service", () => { const local = { services: { shared: { @@ -559,8 +559,8 @@ describe("mergeImportedConfig", () => { const merged = mergeImportedConfig(local, imported); const shared = merged.services.shared!; - expect(shared.backend).toBe("http"); - expect(shared.source).toBe("remote"); + expect(shared.backend).toBe("stdio"); + expect(shared.source).toBe("local"); }); test("imported services default to remote source", () => {