mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-06 06:41:08 +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"],
|
||||
|
||||
@@ -27,8 +27,9 @@ function setProcessTitleForCommand(actionCommand: Command) {
|
||||
process.title = `${cliName}-${name}`;
|
||||
}
|
||||
|
||||
// Commands that need channel plugins loaded
|
||||
// Commands that need plugins loaded before execution.
|
||||
const PLUGIN_REQUIRED_COMMANDS = new Set([
|
||||
"agent",
|
||||
"message",
|
||||
"channels",
|
||||
"directory",
|
||||
|
||||
Reference in New Issue
Block a user