mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 10:30:44 +00:00
fix(cli): repair agent runtime deps during startup
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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"),
|
||||
},
|
||||
},
|
||||
|
||||
@@ -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),
|
||||
});
|
||||
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user