hermes - 💡(How to fix) Fix AttributeError: 'NoneType' object has no 'channel_prompt' attribute [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

AttributeError: 'NoneType' object has no 'channel_prompt' attribute

Root Cause

  1. Feishu adapter (gateway/platforms/feishu.py): The MessageEvent is created without passing channel_prompt parameter (lines 2800-2814), unlike Discord/Telegram adapters that have explicit channel_prompt handling.

  2. Direct attribute access: Code assumes event is never None, but some platforms (Feishu) may create incomplete MessageEvent objects.

Fix Action

Fixed

Code Example

AttributeError: 'NoneType' object has no 'channel_prompt' attribute

---

channel_prompt=getattr(event, 'channel_prompt', None)
RAW_BUFFERClick to expand / collapse

Bug Description

When Hermes processes some messages (particularly from Feishu platform), it throws:

AttributeError: 'NoneType' object has no 'channel_prompt' attribute

Steps to Reproduce

  1. Start Hermes with Feishu adapter enabled
  2. Send a message (particularly at 15:30-16:00 for closing market operations)
  3. Agent fails with the above error

Error Location

The error occurs in multiple locations in gateway/run.py where event.channel_prompt is accessed directly without null checking:

FileLineCode
gateway/run.py5226channel_prompt=event.channel_prompt
gateway/run.py5253channel_prompt=event.channel_prompt
gateway/run.py5275channel_prompt=event.channel_prompt
gateway/run.py6658channel_prompt=event.channel_prompt
gateway/run.py8309channel_prompt=event.channel_prompt
gateway/run.py8406channel_prompt=event.channel_prompt

Root Cause

  1. Feishu adapter (gateway/platforms/feishu.py): The MessageEvent is created without passing channel_prompt parameter (lines 2800-2814), unlike Discord/Telegram adapters that have explicit channel_prompt handling.

  2. Direct attribute access: Code assumes event is never None, but some platforms (Feishu) may create incomplete MessageEvent objects.

Suggested Fix

  1. Add null check before accessing event.channel_prompt:

    channel_prompt=getattr(event, 'channel_prompt', None)
  2. Or use Optional pattern in function signatures with proper defaults.

Environment

  • Hermes version: Latest (hermes-agent submodule)
  • Platform: Feishu
  • Python environment

Reported by: Benson

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

hermes - 💡(How to fix) Fix AttributeError: 'NoneType' object has no 'channel_prompt' attribute [1 pull requests]