mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-18 16:14:44 +00:00
fix(cli): preload plugins for local agent runs
This commit is contained in:
@@ -118,6 +118,11 @@ describe("registerPreActionHooks", () => {
|
||||
|
||||
function buildProgram() {
|
||||
const program = new Command().name("openclaw");
|
||||
program
|
||||
.command("agent")
|
||||
.requiredOption("-m, --message <text>")
|
||||
.option("--local")
|
||||
.action(() => {});
|
||||
program
|
||||
.command("status")
|
||||
.option("--json")
|
||||
@@ -223,6 +228,19 @@ describe("registerPreActionHooks", () => {
|
||||
processTitleSetSpy.mockRestore();
|
||||
});
|
||||
|
||||
it("loads plugins for local agent runs", async () => {
|
||||
await runPreAction({
|
||||
parseArgv: ["agent"],
|
||||
processArgv: ["node", "openclaw", "agent", "--local", "--message", "hi"],
|
||||
});
|
||||
|
||||
expect(ensureConfigReadyMock).toHaveBeenCalledWith({
|
||||
runtime: runtimeMock,
|
||||
commandPath: ["agent"],
|
||||
});
|
||||
expect(ensurePluginRegistryLoadedMock).toHaveBeenCalledWith({ scope: "all" });
|
||||
});
|
||||
|
||||
it("keeps setup alias and channels add manifest-first", async () => {
|
||||
await runPreAction({
|
||||
parseArgv: ["onboard"],
|
||||
|
||||
Reference in New Issue
Block a user