@@ -433,8 +433,8 @@ class Agent_Agentflow implements INode {
433
433
for ( const store of stores ) {
434
434
if ( store . status === 'UPSERTED' ) {
435
435
const obj = {
436
- name : ` ${ store . id } : ${ store . name } ` ,
437
- label : store . name ,
436
+ name : store . id , // Store only the ID, not the name
437
+ label : store . name , // Display the current name
438
438
description : store . description
439
439
}
440
440
returnData . push ( obj )
@@ -547,7 +547,22 @@ class Agent_Agentflow implements INode {
547
547
const nodeInstanceFilePath = options . componentNodes [ 'retrieverTool' ] . filePath as string
548
548
const nodeModule = await import ( nodeInstanceFilePath )
549
549
const newRetrieverToolNodeInstance = new nodeModule . nodeClass ( )
550
- const [ storeId , storeName ] = knowledgeBase . documentStore . split ( ':' )
550
+
551
+ // Handle both old format (id:name) and new format (id only)
552
+ let storeId = knowledgeBase . documentStore
553
+ let storeName = ''
554
+
555
+ if ( knowledgeBase . documentStore . includes ( ':' ) ) {
556
+ // Old format - split to get ID and name
557
+ ; [ storeId , storeName ] = knowledgeBase . documentStore . split ( ':' )
558
+ } else {
559
+ // New format - only ID is stored, need to look up current name
560
+ storeId = knowledgeBase . documentStore
561
+ const appDataSource = options . appDataSource as DataSource
562
+ const databaseEntities = options . databaseEntities as IDatabaseEntity
563
+ const store = await appDataSource . getRepository ( databaseEntities [ 'DocumentStore' ] ) . findOneBy ( { id : storeId } )
564
+ storeName = store ?. name || storeId // Fallback to ID if store not found
565
+ }
551
566
552
567
const docStoreVectorInstanceFilePath = options . componentNodes [ 'documentStoreVS' ] . filePath as string
553
568
const docStoreVectorModule = await import ( docStoreVectorInstanceFilePath )
0 commit comments