Skip to content

fix(tools): add return_exceptions to asyncio.gather in web_tools#2751

Closed
nidhi-singh02 wants to merge 1 commit into
NousResearch:mainfrom
nidhi-singh02:fix/asyncio-gather-error-handling
Closed

fix(tools): add return_exceptions to asyncio.gather in web_tools#2751
nidhi-singh02 wants to merge 1 commit into
NousResearch:mainfrom
nidhi-singh02:fix/asyncio-gather-error-handling

Conversation

@nidhi-singh02

Copy link
Copy Markdown
Contributor

Summary

  • Add return_exceptions=True to all 4 asyncio.gather() calls in tools/web_tools.py
  • Filter out BaseException instances from results with warning-level logging
  • Prevents a single failing LLM summarization task from discarding all other successfully fetched results

Closes #2744

Test Plan

  • Trigger web_extract on multiple URLs where one is unreachable — verify other results are still returned
  • Verify chunk summarization still works when all tasks succeed
  • Verify warning logs appear for failed tasks

Platforms Tested

  • macOS

Prevents a single failing LLM summarization task from discarding
all other successfully fetched results. Each gather call now
gracefully skips failed tasks and logs warnings.
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/tools Tool registry, model_tools, toolsets tool/web Web search and extraction labels May 3, 2026
teknium1 added a commit that referenced this pull request May 15, 2026
PR #2751 salvage. CI requires AUTHOR_MAP coverage for all
contributor commit emails.
@teknium1

Copy link
Copy Markdown
Contributor

Merged via #26244 — your commit was cherry-picked onto current main with your authorship preserved in git log (eacb398). The 4th call site your PR touched had been removed when firecrawl crawl moved to its plugin, so we applied the fix to the remaining 3 sites and cleaned up the chunk-summarize sort key. Thanks for the contribution! 🙏

#26244

@teknium1 teknium1 closed this May 15, 2026
DIZ-admin pushed a commit to DIZ-admin/hermes-agent that referenced this pull request May 16, 2026
PR NousResearch#2751 salvage. CI requires AUTHOR_MAP coverage for all
contributor commit emails.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
PR NousResearch#2751 salvage. CI requires AUTHOR_MAP coverage for all
contributor commit emails.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tools Tool registry, model_tools, toolsets P2 Medium — degraded but workaround exists tool/web Web search and extraction type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: asyncio.gather without return_exceptions discards results on failure

3 participants