fix(cli): repair agent runtime deps during startup

This commit is contained in:
Peter Steinberger
2026-05-01 11:52:01 +01:00
parent ef832f83f6
commit b48dcab1b5
4 changed files with 18 additions and 0 deletions

View File

@@ -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,

View File

@@ -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"),
},
},

View File

@@ -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),
});

View File

@@ -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,
});
});