hermes - 💡(How to fix) Fix [Feature]: Email gateway agent cannot see HTML formatting (font color, size, styles)

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…

Code Example

platforms:
  email:
    preserve_html: true
RAW_BUFFERClick to expand / collapse

Problem

The email gateway adapter strips all HTML formatting from incoming emails before passing them to the agent. The _extract_text_body() function in gateway/platforms/email.py prefers text/plain parts, and when only HTML is available, it strips all tags via a naive regex (_strip_html()).

This means the agent has no visibility into:

  • Font colors (e.g., red text indicating urgency)
  • Font sizes (e.g., headings or emphasis)
  • Background highlights
  • Any inline CSS styling or semantic HTML structure

Use Case

In many workflows, email formatting carries semantic meaning:

  • Highlighted or colored text marking important sections
  • Annotations from shared document review (e.g., red = rejected, green = approved)
  • Structured layouts where visual hierarchy conveys information

Currently, all of this context is lost before the agent sees the email.

Proposed Solution

Add a preserve_html config flag under platforms.email that, when enabled, returns the raw HTML body to the agent instead of stripping tags:

platforms:
  email:
    preserve_html: true

Behavior:

  • false (default) — current behavior, prefers plain text, strips HTML as fallback
  • true — prefers the text/html MIME part and passes it raw to the agent, falls back to plain text if no HTML part exists

This lets LLMs (which can parse HTML natively) see the full formatting context of incoming emails.

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