Skip to content

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ahmedrowaihi
Copy link
Contributor

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

@HenryHengZJ HenryHengZJ requested a review from Copilot July 9, 2025 08:44
Copy link
Contributor

@Copilot Copilot AI left a 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 handle DocumentStoreError.

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.'

@ahmedrowaihi
Copy link
Contributor Author

@HenryHengZJ resolved all copilot comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant