Skip to content

fix(context): add return_exceptions to asyncio.gather in reference expansion - #59258

Closed
x7peeps wants to merge 4 commits into
NousResearch:mainfrom
x7peeps:fix/context-ref-gather-resilience
Closed

fix(context): add return_exceptions to asyncio.gather in reference expansion#59258
x7peeps wants to merge 4 commits into
NousResearch:mainfrom
x7peeps:fix/context-ref-gather-resilience

Conversation

@x7peeps

@x7peeps x7peeps commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Add to in so that a single failed reference expansion does not crash the entire concurrent expansion of all other references.

Problem

calls without when expanding multiple references (file, folder, url, etc.) concurrently. If one reference fails (e.g. a URL fetch times out or a file is unreadable), the exception propagates and aborts all other reference expansions in flight. A message like would lose the expansion too.

Fix

  • Added to the call (1 line change)
  • Added exception handling in the result loop to capture failures as warnings instead of unpacking them as tuples (4 lines)

Testing

  • Syntax check passed (py_compile)
  • Behavior verified: individual reference failures no longer cascade

@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/gateway Gateway runner, session dispatch, delivery platform/qqbot QQ Bot adapter platform/whatsapp WhatsApp Business adapter P3 Low — cosmetic, nice to have labels Jul 6, 2026
@x7peeps

x7peeps commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #59954 (consolidated context reference expansion fix).

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

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have platform/qqbot QQ Bot adapter platform/whatsapp WhatsApp Business adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants