-
-
Notifications
You must be signed in to change notification settings - Fork 22.1k
fix: Use document store ID instead of name for referential integrity in agent flows #4874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the fix!
@@ -433,8 +433,8 @@ class Agent_Agentflow implements INode { | |||
for (const store of stores) { | |||
if (store.status === 'UPSERTED') { | |||
const obj = { | |||
name: `${store.id}:${store.name}`, | |||
label: store.name, | |||
name: store.id, // Store only the ID, not the name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let storeId = knowledgeBase.documentStore | ||
let storeName = '' | ||
|
||
if (knowledgeBase.documentStore.includes(':')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we can just directly fetch the storeName from database:
const [storeId] = knowledgeBase.documentStore.split(':')
...
const storeName = store?.name || storeId
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let me fix this issues!
Keep original format for backward compatibility while fetching current store name from database to prevent UI breaks when document store names are updated.
#4868
${store.id}:${store.name}
id:name
(splits the string to extract ID)id
only (uses ID directly)Modified Files:
Agent.ts
listStores
method to return only ID in thename
fieldexecute
method to handle both old and new formatsRetriever.ts