NousResearch/hermes-agent

Async timeout/event-loop errors in Weixin, Matrix, Mattermost sends

Cluster 12154 · cron · Bug. Data as of

4 open items. Fix merged in #80838 on 7 Aug 2026. Check it covers your case.

The short answer

4open issues
0open PRs
35items grouped
Known?
Yes. 35 related items grouped here, 14 issues already closed.
Fix event
A fix was merged to main in PR #80838. Check it covers your case. No release data is tracked. Fix link checked: 7 Aug 2026.
Tracker
The maintainers' tracker marks this partially resolved, deciding PR #80838. That is separate from the fix event.

Most members report or address the error "Timeout context manager should be used inside a task" (and related cross-event-loop errors) when sending messages or running cron deliveries through Weixin, Matrix, and Mattermost. Proposed changes touch aiohttp timeout handling, event-loop routing for manual cron runs, and session handling, plus a few loosely related Weixin items.

Open issues4

  • Issue#12154[WeChat] asyncio.timeout bug and session expiration not handled gracefully
  • Issue#13365Weixin: Voice send fails - asyncio Task attached to different loop
  • Issue#37005Mattermost plugin: send_message fails with 'Timeout context manager should be used inside a task' (v0.15.x)
  • Issue#39836[Bug] Mattermost cron job delivery fails with "Timeout context manager should be used inside a task"

Open PRs0

No open pull requests.

Fixes on record

Merged to main. A stamp counts the issues a fix is linked to.

  • #21196 fix(weixin): replace aiohttp ClientTimeout with asyncio.wait_for (salvage #19050)

    merged to mainSuggested link · files and diff not shown

  • #80807 fix: dispatch cronjob(action='run') to the background like delegate_task

    merged to main

    files: cron/scheduler.py, tests/tools/test_cronjob_run_background.py, tools/cronjob_tools.py

  • #80838 fix(cron): gateway-loop delivery, per-run prompt context, Matrix standalone send — run-action sweep salvage

    merged to main

    files: cron/scheduler.py, plugins/platforms/matrix/adapter.py, tests/cron/test_cron_kanban_env_isolation.py, tests/cron/test_cron_workdir.py, tests/cron/test_execution_ledger.py, tests/cron/test_parallel_pool.py, tests/cron/test_run_one_job.py, tests/cron/test_scheduler.py, tests/tools/test_cronjob_run_background.py, tests/tools/test_cronjob_run_immediate.py, tools/cronjob_tools.py

14 PRs closed without merging

From the close comments: done elsewhere 4 · merged via another change 3 · closed without comment 1 · duplicate 1 · partial fix 1 · stale or abandoned 1 · superseded by another PR 1 · other 2

  • #12223 fix: report expired Weixin sessions · other
  • #13520 fix(weixin): avoid cross-loop live session reuse · done elsewhere → a22465e, #13350, #12810
  • #15911 fix(weixin): avoid cross-event-loop ClientSession reuse in send_weixin_direct · done elsewhere → a22465e, #13520, #14481, #14873
  • #17545 fix(weixin): route send_message media uploads through a fresh aiohttp session · superseded by another PR → a22465e
  • #18040 fix(weixin): guard against event-loop mismatch in send_weixin_direct · duplicate → #12810
Show 9 more
  • #18714 fix: cross-channel send_message failures (WeChat event loop + Telegram proxy) · done elsewhere → #12370
  • #37599 fix(mattermost): use asyncio.wait_for instead of aiohttp ClientTimeout (#37005) · merged via another change
  • #38525 fix(tools): wrap coroutines in create_task() in _run_async() to fix aiohttp timeout error · closed without comment
  • #39877 fix(mattermost): avoid aiohttp timeout context in sends · other
  • #61502 fix(plugins): use asyncio.wait_for instead of ClientTimeout in Matrix standalone send · merged via another change → #80838, #63586, #61495
  • #61503 fix(cron,desktop): pass gateway loop to run_one_job for Matrix cron delivery; discover UGit git binary (#61495, #61494) · stale or abandoned
  • #63586 fix(cron): deliver manual runs on gateway loop · merged via another change → #80838, #80807, #61495
  • #71132 fix(cron): deliver manual runs on profile-owned gateway loop · partial fix → 5101326, 6777a6b, da8c209, #71132, #61503, #7696, #7958, #17516, #16612, #50025, #32448, #32804, #32427, #33980, #34173, #34255, #34483, #37431, #37859, #41130, #41037, #41167, #41363, #41269, #41307, #50062, #43864, #49792, #49695, #52720, #52705, #53246, #34120, #53395, #57342, #57331, #57360, #57689, #61502, #61495, #61494, #63586, #63774, #374151
  • #77378 fix(gateway): skip cross-loop live adapter in _send_via_adapter · done elsewhere → #62956
Closed issues · 14
  • Closed#13099[Bug]: WeChat send_message causes "Timeout context manager should be used inside a task" error
  • Closed#13281[Bug] send_message tool fails with Weixin: Timeout context manager should be used inside a task
  • Closed#16293[Bug]: Weixin message error
  • Closed#17347[Bug] Weixin send_message fails with "Timeout context manager should be used inside a task"
  • Closed#17595[Weixin] File/image sending fails with asyncio timeout error
  • Closed#18014Bug: Cron job delivery to WeChat fails with "Timeout context manager should be used inside a task"
  • Closed#18437[Bug] Weixin send_message fails with event-loop errors in non-gateway sessions (v0.11.0)
  • Closed#18791[Bug] Weixin send_message fails with 'Timeout context manager should be used inside a task'
  • Closed#18836[Bug] Weixin Gateway: Timeout context manager should be used inside a task
  • Closed#20229WeChat adapter: "Timeout context manager should be used inside a task" error when cron job delivers to WeChat
  • Closed#23371send_message weixin: asyncio 'Future attached to a different loop' bug
  • Closed#24142[Bug]: Weixin send_message fails: 'Timeout context manager should be used inside a task'
  • Closed#29037fix(weixin): replace aiohttp ClientTimeout with asyncio.wait_for()
  • Closed#61495[Bug]: Matrix manual cron delivery fails with "Timeout context manager should be used inside a task"
How this cluster was grouped
  • Link evidence (partly structural links): some members are connected by structural evidence (shared changed files, or a closing/superseded reference); the rest are joined by an automated relevance judgement over their text.
  • Members outside that structural core may belong to a different underlying problem.
  • Pairwise link density 0.06: the share of item pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. 1.00 means every pair is linked.

For your agent

The same facts, typed.