@@ -614,7 +614,6 @@ describe("runCli exit behavior", () => {
614614 } ) ;
615615
616616 it ( "does not load inactive provider cleanup modules for cold help" , async ( ) => {
617- tryRouteCliMock . mockResolvedValueOnce ( false ) ;
618617 const parseAsync = vi . fn ( ) . mockResolvedValueOnce ( undefined ) ;
619618 buildProgramMock . mockReturnValueOnce ( {
620619 commands : [ { name : ( ) => "nodes" , aliases : ( ) => [ ] } ] ,
@@ -2279,6 +2278,26 @@ describe("runCli exit behavior", () => {
22792278 expect ( closeActiveMemorySearchManagersMock ) . not . toHaveBeenCalled ( ) ;
22802279 } ) ;
22812280
2281+ it . each ( [
2282+ [ "plugins install" , [ "plugins" , "install" , "--help" ] ] ,
2283+ [ "plugins list" , [ "plugins" , "list" , "--help" ] ] ,
2284+ [ "gateway status" , [ "gateway" , "status" , "--help" ] ] ,
2285+ ] ) ( "renders %s help without importing the command router" , async ( _name , args ) => {
2286+ const argv = [ "node" , "openclaw" , ...args ] ;
2287+ const parseAsync = vi . fn ( ) . mockResolvedValueOnce ( undefined ) ;
2288+ const program = {
2289+ commands : [ { name : ( ) => args [ 0 ] , aliases : ( ) => [ ] } ] ,
2290+ parseAsync,
2291+ } ;
2292+ buildProgramMock . mockReturnValueOnce ( program ) ;
2293+
2294+ await runCli ( argv ) ;
2295+
2296+ expect ( tryRouteCliMock ) . not . toHaveBeenCalled ( ) ;
2297+ expect ( registerSubCliByNameMock ) . toHaveBeenCalledWith ( program , args [ 0 ] , argv ) ;
2298+ expect ( parseAsync ) . toHaveBeenCalledWith ( argv ) ;
2299+ } ) ;
2300+
22822301 it ( "propagates precomputed help metadata failures" , async ( ) => {
22832302 outputPrecomputedSecretsHelpTextMock . mockImplementationOnce ( ( ) => {
22842303 throw new Error ( "startup metadata failed" ) ;
0 commit comments