Skip to content

fix(hatching-triage-sandbox): handle search API errors gracefully (#4756)#7081

Open
throuxel wants to merge 1 commit into
masterfrom
fix/4756/hatching-triage-url-enrichment-error
Open

fix(hatching-triage-sandbox): handle search API errors gracefully (#4756)#7081
throuxel wants to merge 1 commit into
masterfrom
fix/4756/hatching-triage-url-enrichment-error

Conversation

@throuxel

Copy link
Copy Markdown
Member

Proposed changes

  • Catch ServerError from the triage library in _search_for_analysis to handle 504 timeouts and other API errors gracefully
  • When the search API fails, log a warning and fall back to submitting a new sample instead of crashing

Related issues

Checklist

  • I consider the submitted work as finished
  • I have signed my commits using GPG key.
  • I tested the code for its functionality using different use cases
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality

Further comments

The root cause was that iterating the search paginator could raise an unhandled ServerError when 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 returns None so the connector gracefully falls back to submitting a new analysis instead of hanging.

Copilot AI review requested due to automatic review settings July 22, 2026 14:02
@Filigran-Automation Filigran-Automation added the filigran team Item from the Filigran team. label Jul 22, 2026
@github-actions

Copy link
Copy Markdown

🔴 Connector Linter errors detected

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

filigran team Item from the Filigran team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(hatching-triage): unable to enrich URL

4 participants