Skip to content

fix(qqbot): add return_exceptions=True to asyncio.gather in chunked upload - #66657

Closed
x7peeps wants to merge 1 commit into
NousResearch:mainfrom
x7peeps:fix/qqbot-upload-gather-upstream
Closed

fix(qqbot): add return_exceptions=True to asyncio.gather in chunked upload#66657
x7peeps wants to merge 1 commit into
NousResearch:mainfrom
x7peeps:fix/qqbot-upload-gather-upstream

Conversation

@x7peeps

@x7peeps x7peeps commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Add return_exceptions=True to the asyncio.gather() call in _run_with_concurrency used by the QQBot chunked file upload pipeline.

Problem

The asyncio.gather() at gateway/platforms/qqbot/chunked_upload.py:602 had no return_exceptions=True. When uploading a multi-part file, if any single part upload failed (network error, server rejection, etc.), gather() would cancel all other concurrent uploads rather than letting them finish, wasting bandwidth and potentially leaving the upload in an inconsistent state. This is the same pattern already fixed in trajectory_compressor (PR #65932), context_references (PR #62902), and feishu (PR #64864).

Fix

  • Pass return_exceptions=True to asyncio.gather() so each part upload runs to completion regardless of sibling failures.
  • Collect any exceptions from results and re-raise the first one, preserving the existing -> None return contract of _run_with_concurrency.

Testing

  • Syntax check passed (py_compile)
  • Behavior verified

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery platform/qqbot QQ Bot adapter sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages needs-decision Awaiting maintainer decision before any implementation labels Jul 18, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related to #61302 at the same QQBot gather site. #61302's one-line return_exceptions=True change would swallow failures; this PR instead re-raises after sibling uploads complete. Maintainer choice is needed.

@x7peeps

x7peeps commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

Closing as duplicate

@x7peeps x7peeps closed this Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery needs-decision Awaiting maintainer decision before any implementation P3 Low — cosmetic, nice to have platform/qqbot QQ Bot adapter sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants