hermes - 💡(How to fix) Fix [Bug]: Default Docker image missing `markdown` dep — cron delivery silently falls back to plain text despite PR #5271 [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

try: import markdown as _md ... formatted_body = ... # only reached if markdown is installed except ImportError: pass

falls through to plain-text send

Root Cause

Root Cause Analysis (optional)

Fix Action

Fixed

Code Example

Report       https://paste.rs/LsTHg
agent.log    https://paste.rs/BfIoK
gateway.log  https://paste.rs/V0Jks

---



---

try:
    import markdown as _md
    ...
    formatted_body = ...   # only reached if markdown is installed
except ImportError:
    pass
# falls through to plain-text send
RAW_BUFFERClick to expand / collapse

Bug Description

PR #5271 (merged 2026-04-05) added markdown-to-HTML conversion to _send_matrix() and the cron delivery path — great improvement. However, the markdown Python library is still treated as an optional dep with a silent plain-text fallback, and it is not shipped in the official nousresearch/hermes-agent Docker image. The result: out-of-the-box cron deliveries still render in Element as raw markdown — literal ##, **, |...| — even on images released after the PR merged.

Steps to Reproduce

  1. docker pull nousresearch/hermes-agent:latest (any tag that includes PR #5271).
  2. Configure the Matrix gateway and a cron job whose prompt instructs the LLM to reply in Markdown (headings, lists, tables).
  3. hermes cron run <job_id> and observe the message that arrives in Element.

Expected Behavior

Element (one of the main matrix clients) renders the message with headings, lists, and tables formatted via formatted_body (format: org.matrix.custom.html).

Actual Behavior

Element shows the raw Markdown source. The Matrix event has no formatted_body — only the plain body. The markdown library is missing from the image venv, so the except ImportError branch fires and the conversion is silently skipped.

Affected Component

Gateway (Telegram/Discord/Slack/WhatsApp)

Messaging Platform (if gateway-related)

No response

Debug Report

Report       https://paste.rs/LsTHg
agent.log    https://paste.rs/BfIoK
gateway.log  https://paste.rs/V0Jks

Operating System

Ubuntu 24.04.4

Python Version

Python 3.12.3

Hermes Version

Hermes Agent v0.14.0 (2026.5.16)

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

PR #5271 left the import guarded:

try:
    import markdown as _md
    ...
    formatted_body = ...   # only reached if markdown is installed
except ImportError:
    pass
# falls through to plain-text send

The markdown library is not listed in pyproject.toml (or equivalent) as a required dep, and is not installed in the Docker image's venv alongside mautrix. So every user starting from the official image hits the fallback silently.

Proposed Fix (optional)

  1. Ship markdown in the official Docker image — add it to whatever pip install layer carries mautrix. This is the minimal change: no dep changes, no code changes.
  2. Or make markdown a hard dependency in pyproject.toml. The library is ~50 KB, has no compiled extensions, and is now on the default delivery path. The optional-import pattern is vestigial.
  3. Or (least preferred) align the cron-path fallback with the interactive path's regex _markdown_to_html_fallback, so plain text is never silently returned when the lib is missing.

Options (1) or (2) are preferable — they remove the invisible footgun without adding complexity.

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