@@ -631,22 +631,27 @@ export function registerMemoryCli(program: Command) {
631631 . option ( "--shared" , "Index only the shared memory store" , false )
632632 . option ( "--verbose" , "Verbose logging" , false )
633633 . action ( async ( opts : MemoryCommandOptions & { shared ?: boolean } ) => {
634+ setVerbose ( Boolean ( opts . verbose ) ) ;
634635 // Handle --shared: sync only the shared store
635636 if ( opts . shared ) {
636637 const { SHARED_AGENT_ID } = await import ( "../memory/shared-constants.js" ) ;
637- const { config : cfg } = await loadMemoryCommandConfig ( "memory index" ) ;
638+ const { config : cfg , diagnostics } = await loadMemoryCommandConfig ( "memory index" ) ;
639+ emitMemorySecretResolveDiagnostics ( diagnostics ) ;
638640 await withMemoryManagerForAgent ( {
639641 cfg,
640642 agentId : SHARED_AGENT_ID ,
641643 run : async ( manager ) => {
644+ if ( ! manager . sync ) {
645+ defaultRuntime . log ( "Shared store sync not available." ) ;
646+ return ;
647+ }
642648 defaultRuntime . log ( "Syncing shared memory store…" ) ;
643- await manager . sync ?. ( { reason : "cli" , force : Boolean ( opts . force ) } ) ;
649+ await manager . sync ( { reason : "cli" , force : Boolean ( opts . force ) } ) ;
644650 defaultRuntime . log ( "Shared store synced." ) ;
645651 } ,
646652 } ) ;
647653 return ;
648654 }
649- setVerbose ( Boolean ( opts . verbose ) ) ;
650655 const { config : cfg , diagnostics } = await loadMemoryCommandConfig ( "memory index" ) ;
651656 emitMemorySecretResolveDiagnostics ( diagnostics ) ;
652657 const agentIds = resolveAgentIds ( cfg , opts . agent ) ;
0 commit comments