@@ -201,7 +201,7 @@ describe("registerPreActionHooks", () => {
201201 await preActionHook ( program , actionCommand ) ;
202202 }
203203
204- it ( "handles debug mode and plugin-required command preaction" , async ( ) => {
204+ it ( "handles debug mode and config-only command preaction" , async ( ) => {
205205 const processTitleSetSpy = vi . spyOn ( process , "title" , "set" ) ;
206206 await runPreAction ( {
207207 parseArgv : [ "status" ] ,
@@ -229,7 +229,7 @@ describe("registerPreActionHooks", () => {
229229 runtime : runtimeMock ,
230230 commandPath : [ "agents" , "list" ] ,
231231 } ) ;
232- expect ( ensurePluginRegistryLoadedMock ) . toHaveBeenCalledWith ( { scope : "all" } ) ;
232+ expect ( ensurePluginRegistryLoadedMock ) . not . toHaveBeenCalled ( ) ;
233233 processTitleSetSpy . mockRestore ( ) ;
234234 } ) ;
235235
@@ -512,19 +512,13 @@ describe("registerPreActionHooks", () => {
512512 expect ( loggingState . forceConsoleToStderr ) . toBe ( false ) ;
513513 } ) ;
514514
515- it ( "does not route logs to stderr during plugin loading without --json" , async ( ) => {
516- let stderrDuringPluginLoad = false ;
517- ensurePluginRegistryLoadedMock . mockImplementation ( ( ) => {
518- stderrDuringPluginLoad = loggingState . forceConsoleToStderr ;
519- } ) ;
520-
515+ it ( "does not preload plugins or route logs to stderr for agents list without --json" , async ( ) => {
521516 await runPreAction ( {
522517 parseArgv : [ "agents" , "list" ] ,
523518 processArgv : [ "node" , "openclaw" , "agents" , "list" ] ,
524519 } ) ;
525520
526- expect ( ensurePluginRegistryLoadedMock ) . toHaveBeenCalled ( ) ;
527- expect ( stderrDuringPluginLoad ) . toBe ( false ) ;
521+ expect ( ensurePluginRegistryLoadedMock ) . not . toHaveBeenCalled ( ) ;
528522 expect ( loggingState . forceConsoleToStderr ) . toBe ( false ) ;
529523 } ) ;
530524
0 commit comments