From b48dcab1b52ecd1c09133ac015fd486c549802e0 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 1 May 2026 11:52:01 +0100 Subject: [PATCH] fix(cli): repair agent runtime deps during startup --- src/cli/command-bootstrap.test.ts | 14 ++++++++++++++ src/cli/command-catalog.ts | 1 + src/cli/command-path-policy.test.ts | 1 + src/cli/program/preaction.test.ts | 2 ++ 4 files changed, 18 insertions(+) diff --git a/src/cli/command-bootstrap.test.ts b/src/cli/command-bootstrap.test.ts index 8f99f92f094..c077bd6947b 100644 --- a/src/cli/command-bootstrap.test.ts +++ b/src/cli/command-bootstrap.test.ts @@ -87,6 +87,20 @@ describe("ensureCliCommandBootstrap", () => { }); }); + it("loads agent command plugins with bundled runtime repair enabled", async () => { + await ensureCliCommandBootstrap({ + runtime: {} as never, + commandPath: ["agent"], + loadPlugins: true, + }); + + expect(ensureCliPluginRegistryLoadedMock).toHaveBeenCalledWith({ + scope: "all", + routeLogsToStderr: undefined, + installBundledRuntimeDeps: true, + }); + }); + it("does nothing extra when plugin loading is disabled", async () => { await ensureCliCommandBootstrap({ runtime: {} as never, diff --git a/src/cli/command-catalog.ts b/src/cli/command-catalog.ts index 589f55be8cc..e388b5c405b 100644 --- a/src/cli/command-catalog.ts +++ b/src/cli/command-catalog.ts @@ -59,6 +59,7 @@ export const cliCommandCatalog: readonly CliCommandCatalogEntry[] = [ commandPath: ["agent"], policy: { loadPlugins: ({ argv, jsonOutputMode }) => hasFlag(argv, "--local") || !jsonOutputMode, + pluginRegistry: { scope: "all", installBundledRuntimeDeps: true }, networkProxy: ({ argv }) => (hasFlag(argv, "--local") ? "default" : "bypass"), }, }, diff --git a/src/cli/command-path-policy.test.ts b/src/cli/command-path-policy.test.ts index c4cb4a023d9..ab00df9618c 100644 --- a/src/cli/command-path-policy.test.ts +++ b/src/cli/command-path-policy.test.ts @@ -90,6 +90,7 @@ describe("command-path-policy", () => { it("keeps config-only agent commands on config-only startup", () => { expectResolvedPolicy(["agent"], { loadPlugins: expect.any(Function), + pluginRegistry: { scope: "all", installBundledRuntimeDeps: true }, networkProxy: expect.any(Function), }); diff --git a/src/cli/program/preaction.test.ts b/src/cli/program/preaction.test.ts index d29f3b9c656..8e55be42880 100644 --- a/src/cli/program/preaction.test.ts +++ b/src/cli/program/preaction.test.ts @@ -245,6 +245,7 @@ describe("registerPreActionHooks", () => { }); expect(ensurePluginRegistryLoadedMock).toHaveBeenCalledWith({ scope: "all", + installBundledRuntimeDeps: true, }); }); @@ -261,6 +262,7 @@ describe("registerPreActionHooks", () => { }); expect(ensurePluginRegistryLoadedMock).toHaveBeenCalledWith({ scope: "all", + installBundledRuntimeDeps: true, }); });