Gather evidence fails gracefully on timeout#1103
Conversation
|
You have run out of free Bugbot PR reviews for this billing cycle. This will reset on October 5. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
There was a problem hiding this comment.
Pull Request Overview
This PR adds graceful timeout handling to the map_fxn_summary function to prevent timeout errors from bubbling up to tool calls. Instead of allowing timeout exceptions to break the entire context creation process, the code now catches timeout errors and returns None, allowing other successful contexts to still be processed.
Key changes:
- Added timeout-specific error handling with a new
LLMContextTimeoutErrorexception - Refactored the error hierarchy with a base
LLMContextErrorclass - Enhanced error handling to differentiate between retryable and non-retryable errors
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/paperqa/core.py | Added timeout exception handling, refactored error hierarchy, and improved error categorization |
| tests/test_paperqa.py | Added comprehensive test for timeout resilience and various formatting improvements |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
We basically never want to see this as a response to a gather evidence tool call:
We were previously bubbling up timeout errors all the way up to the tool call. Even one context failure would prevent all other successes from making it through. This PR catches and returns None if we timeout.
We may want to extend this to e.g. the BadRequestErrors, but sticking to Timeouts for now.