Skip to content
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

[Bug]: Agents - concurrents file deletion requests erratic behaviour #5160

Closed
1 task done
thingersoft opened this issue Jan 2, 2025 · 0 comments · Fixed by #5159
Closed
1 task done

[Bug]: Agents - concurrents file deletion requests erratic behaviour #5160

thingersoft opened this issue Jan 2, 2025 · 0 comments · Fixed by #5159
Labels
bug Something isn't working

Comments

@thingersoft
Copy link
Contributor

What happened?

Concurrent file deletion requests for agents RAG tool can lead to inconsistent DB state.
In these cases the tool resouce file ids array contains entries for deleted files.

Similarly to #4746 on server side the agent update logic includes two async operations, one to retrieve the agent and the following to update it based on the previously retrieved data.
With multiple concurrent requests being processed the retrieved data can become stale, causing the reported issue.

Steps to Reproduce

  1. configure RAG
  2. configure an agent
  3. enable file search for the agent
  4. upload 2 documents
  5. while debugging put a breakpoint just after the agent retrieval in removeAgentResourceFiles from /api/models/Agent.js
  6. delete the first file and wait for the request to trigger the breakpoint
  7. delete the second file and wait for the request to trigger the breakpoint
  8. resume the first file deletion and wait for it to complete
  9. resume the second file deletion and wait for it to complete

You'll and up with the first file id still associated with the agent while no file is showing in the UI.

What browsers are you seeing the problem on?

No response

Relevant log output

No response

Screenshots

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@thingersoft thingersoft added the bug Something isn't working label Jan 2, 2025
thingersoft added a commit to thingersoft/LibreChat that referenced this issue Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant