hermes - 💡(How to fix) Fix [Bug]: Weixin send_message fails: 'Timeout context manager should be used inside a task' [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Operating System

Linux (Docker container)

Python Version

3.11.15

Hermes Version

v0.13.0 (2026.5.7)

Additional Logs / Traceback (optional)

Root Cause

Root Cause Analysis (optional)

Fix Action

Fixed

Code Example

send_message(target="weixin", message="Test message")

### Expected Behavior

{"error": "Weixin send failed: Timeout context manager should be used inside a task"}

### Actual Behavior

{"error": "Weixin send failed: Timeout context manager should be used inside a task"}

### Affected Component

Gateway (Telegram/Discord/Slack/WhatsApp), Other

### Messaging Platform (if gateway-related)

_No response_

### Debug Report

---

### Operating System

Linux (Docker container)

### Python Version

3.11.15

### Hermes Version

v0.13.0 (2026.5.7)

### Additional Logs / Traceback (optional)
RAW_BUFFERClick to expand / collapse

Bug Description

Bug Description

send_message tool fails when sending messages to Weixin (WeChat) platform with the error:

Steps to Reproduce

This error occurs 100% of the time when attempting to send any message via Weixin.

Steps to Reproduce

  1. Configure Weixin platform with valid user ID
  2. Call send_message tool with target="weixin" or target="weixin:USER_ID"
  3. Any message content triggers the same error

Example:

send_message(target="weixin", message="Test message")

### Expected Behavior

{"error": "Weixin send failed: Timeout context manager should be used inside a task"}

### Actual Behavior

{"error": "Weixin send failed: Timeout context manager should be used inside a task"}

### Affected Component

Gateway (Telegram/Discord/Slack/WhatsApp), Other

### Messaging Platform (if gateway-related)

_No response_

### Debug Report

```shell
Hermes Version: v0.13.0 (2026.5.7) Python Version: 3.11.15 OS: Linux (container)

Operating System

Linux (Docker container)

Python Version

3.11.15

Hermes Version

v0.13.0 (2026.5.7)

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

The error message Timeout context manager should be used inside a task suggests an async programming issue:

  • The Weixin platform adapter likely uses async with timeout() or similar async context manager
  • This is being called from a synchronous context instead of an async task
  • The timeout management needs to be wrapped in asyncio.create_task() or called from an async function Likely location: gateway/platforms/weixin.py or the base platform class that handles message sending with timeout.

Additional Context

  • Script execution works fine (daily_push.py generates content successfully)
  • Cronjob runs on schedule
  • Only the final send_message call fails
  • This affects all Weixin messaging, not just cronjobs
  • Bug persists after upgrading from v0.11.0 to v0.13.0

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING