-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
feat: "fault tolerance" prevent agent execution error on failed retrieving #4812
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.
Pull Request Overview
This PR enhances fault tolerance by ensuring agent flows degrade gracefully when document or vector stores are unavailable. Key changes include:
- Added
DocumentStoreError
to standardize store-related errors. - Updated agent flow execution in
buildAgentflow.ts
to catch store errors and continue instead of failing. - Wrapped store initialization and retrieval in
RetrieverTool
,DocStoreVector
, and agentflow nodes to throw and handleDocumentStoreError
.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
packages/server/src/utils/buildAgentflow.ts | Catch store errors in executeNode and executeAgentFlow , push warnings and continue execution. |
packages/components/src/error.ts | Introduced DocumentStoreError class. |
packages/components/nodes/vectorstores/DocumentStoreVS/DocStoreVector.ts | Throw DocumentStoreError on init failures. |
packages/components/nodes/tools/RetrieverTool/RetrieverTool.ts | Catch store errors during retrieval and fallback to general knowledge. |
packages/components/nodes/agentflow/Retriever/Retriever.ts | Wrap document store init/invoke to throw/handle DocumentStoreError . |
packages/components/nodes/agentflow/Agent/Agent.ts | Similar error wrapping in agent knowledge store initialization. |
Comments suppressed due to low confidence (1)
packages/components/nodes/tools/RetrieverTool/RetrieverTool.ts:219
- Add a unit or integration test to cover this fallback path and verify that the correct fallback string is returned when a store error occurs.
return 'Knowledge base temporarily unavailable. Proceeding with general knowledge.'
packages/components/nodes/vectorstores/DocumentStoreVS/DocStoreVector.ts
Outdated
Show resolved
Hide resolved
…s changes or failed retreivers
…or handling with cause property
@HenryHengZJ resolved all copilot comments |
agent response should not fail, if store is not ready.
a store could change its status from time to time during adding/removing loaders.
agent should continue functioning with degrading