fix(hatching-triage-sandbox): handle search API errors gracefully (#4756)#7081
Open
throuxel wants to merge 1 commit into
Open
fix(hatching-triage-sandbox): handle search API errors gracefully (#4756)#7081throuxel wants to merge 1 commit into
throuxel wants to merge 1 commit into
Conversation
|
🔴 Connector Linter errors detected
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Hatching Triage Sandbox connector to avoid crashing when the Triage search API fails during _search_for_analysis, allowing the connector to fall back to submitting a new sample instead of hanging or failing the message.
Changes:
- Wraps iteration of the Triage search paginator in a try/except and logs a warning on failure.
- Adds unit tests covering the “search fails → return None + warn” behavior for
_search_for_analysis.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| internal-enrichment/hatching-triage-sandbox/src/connector/connector.py | Adds error handling around search pagination to prevent connector crashes on Triage API failures. |
| internal-enrichment/hatching-triage-sandbox/tests/tests_connector/test_connector.py | Introduces tests for _search_for_analysis behavior when the search API errors and when existing analysis is disabled. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
ServerErrorfrom the triage library in_search_for_analysisto handle 504 timeouts and other API errors gracefullyRelated issues
Checklist
Further comments
The root cause was that iterating the search paginator could raise an unhandled
ServerErrorwhen the Triage API returns a 504 Gateway Timeout with a non-JSON body. The fix wraps the iteration in a try/except block, logs the error, and returnsNoneso the connector gracefully falls back to submitting a new analysis instead of hanging.