Skip to content

fix(web): catch aiohttp.ClientError in SearchWeb to prevent unhandled crash#1586

Open
ascl1u wants to merge 2 commits intoMoonshotAI:mainfrom
ascl1u:fix/catch-network-error
Open

fix(web): catch aiohttp.ClientError in SearchWeb to prevent unhandled crash#1586
ascl1u wants to merge 2 commits intoMoonshotAI:mainfrom
ascl1u:fix/catch-network-error

Conversation

@ascl1u
Copy link
Copy Markdown

@ascl1u ascl1u commented Mar 25, 2026

Description

SearchWeb.__call__ does not catch aiohttp.ClientError, so network failures propagate as unhandled exceptions and crash the agent loop. FetchURL in the same package already handles this correctly.

This PR wraps the session.post() call in a try/except aiohttp.ClientError block and returns a graceful tool error, matching the existing pattern in fetch.py.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked the related issue, if any.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have run make gen-changelog to update the changelog.
  • I have run make gen-docs to update the user documentation.

Open with Devin

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant