Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR enables concurrent execution of search tools by introducing a CONCURRENCY_SAFE class variable to NamedTool and marking PaperSearch and ClinicalTrialsSearch as safe for concurrent execution. The change allows the agent to run multiple search operations in parallel, improving performance.
Key Changes:
- Added
CONCURRENCY_SAFEclass variable toNamedToolbase class (defaults toFalse) - Marked
PaperSearchandClinicalTrialsSearchas concurrency-safe - Updated
settings_to_toolsto passconcurrency_safeflag when creating tools - Changed
Environment.stepto enable concurrent tool execution
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/paperqa/agents/tools.py | Added CONCURRENCY_SAFE class variable and marked search tools as safe for concurrent execution; reformatted docstring formatting |
| src/paperqa/agents/env.py | Updated tool creation to pass concurrency_safe flag and enabled concurrent execution in step method |
| tests/test_agents.py | Updated test cases to include concurrency_safe parameter when creating tools; minor formatting cleanup |
| pyproject.toml | Updated fhaviary dependency version to support partial tool concurrency |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
Comment @cursor review or bugbot run to trigger another review on this PR
b6e9bf4 to
fbdc6e1
Compare
It is safe for search tools to run concurrently with each other, so this PR enables that.