@@ -46,6 +46,7 @@ import {
46
46
type Memory ,
47
47
} from "./types.ts" ;
48
48
import { stringToUuid } from "./uuid.ts" ;
49
+ import _ from "lodash" ;
49
50
50
51
/**
51
52
* Represents the runtime environment for an agent, handling message processing,
@@ -340,11 +341,13 @@ export class AgentRuntime implements IAgentRuntime {
340
341
341
342
this . token = opts . token ;
342
343
343
- this . plugins = [
344
+ const allPlugins = [
344
345
...( opts . character ?. plugins ?? [ ] ) ,
345
346
...( opts . plugins ?? [ ] ) ,
346
347
] ;
347
348
349
+ this . plugins = _ . uniqBy ( allPlugins , "name" ) ;
350
+
348
351
this . plugins . forEach ( ( plugin ) => {
349
352
plugin . actions ?. forEach ( ( action ) => {
350
353
this . registerAction ( action ) ;
@@ -410,22 +413,27 @@ export class AgentRuntime implements IAgentRuntime {
410
413
}
411
414
412
415
async stop ( ) {
413
- elizaLogger . debug ( ' runtime::stop - character' , this . character )
414
- // stop services, they don't have a stop function
416
+ elizaLogger . debug ( " runtime::stop - character" , this . character ) ;
417
+ // stop services, they don't have a stop function
415
418
// just initialize
416
419
417
- // plugins
420
+ // plugins
418
421
// have actions, providers, evaluators (no start/stop)
419
422
// services (just initialized), clients
420
423
421
- // client have a start
422
- for ( const cStr in this . clients ) {
423
- const c = this . clients [ cStr ]
424
- elizaLogger . log ( 'runtime::stop - requesting' , cStr , 'client stop for' , this . character . name )
425
- c . stop ( )
426
- }
427
- // we don't need to unregister with directClient
428
- // don't need to worry about knowledge
424
+ // client have a start
425
+ for ( const cStr in this . clients ) {
426
+ const c = this . clients [ cStr ] ;
427
+ elizaLogger . log (
428
+ "runtime::stop - requesting" ,
429
+ cStr ,
430
+ "client stop for" ,
431
+ this . character . name
432
+ ) ;
433
+ c . stop ( ) ;
434
+ }
435
+ // we don't need to unregister with directClient
436
+ // don't need to worry about knowledge
429
437
}
430
438
431
439
/**
0 commit comments