mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-13 15:50:43 +00:00
Fix CLI text command hangs (#74220)
* fix(cli): keep agents list off plugin preload * docs(changelog): note cli text hang fix * test(cli): update preaction agents list expectations
This commit is contained in:
@@ -201,7 +201,7 @@ describe("registerPreActionHooks", () => {
|
||||
await preActionHook(program, actionCommand);
|
||||
}
|
||||
|
||||
it("handles debug mode and plugin-required command preaction", async () => {
|
||||
it("handles debug mode and config-only command preaction", async () => {
|
||||
const processTitleSetSpy = vi.spyOn(process, "title", "set");
|
||||
await runPreAction({
|
||||
parseArgv: ["status"],
|
||||
@@ -229,7 +229,7 @@ describe("registerPreActionHooks", () => {
|
||||
runtime: runtimeMock,
|
||||
commandPath: ["agents", "list"],
|
||||
});
|
||||
expect(ensurePluginRegistryLoadedMock).toHaveBeenCalledWith({ scope: "all" });
|
||||
expect(ensurePluginRegistryLoadedMock).not.toHaveBeenCalled();
|
||||
processTitleSetSpy.mockRestore();
|
||||
});
|
||||
|
||||
@@ -512,19 +512,13 @@ describe("registerPreActionHooks", () => {
|
||||
expect(loggingState.forceConsoleToStderr).toBe(false);
|
||||
});
|
||||
|
||||
it("does not route logs to stderr during plugin loading without --json", async () => {
|
||||
let stderrDuringPluginLoad = false;
|
||||
ensurePluginRegistryLoadedMock.mockImplementation(() => {
|
||||
stderrDuringPluginLoad = loggingState.forceConsoleToStderr;
|
||||
});
|
||||
|
||||
it("does not preload plugins or route logs to stderr for agents list without --json", async () => {
|
||||
await runPreAction({
|
||||
parseArgv: ["agents", "list"],
|
||||
processArgv: ["node", "openclaw", "agents", "list"],
|
||||
});
|
||||
|
||||
expect(ensurePluginRegistryLoadedMock).toHaveBeenCalled();
|
||||
expect(stderrDuringPluginLoad).toBe(false);
|
||||
expect(ensurePluginRegistryLoadedMock).not.toHaveBeenCalled();
|
||||
expect(loggingState.forceConsoleToStderr).toBe(false);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user