Skip to content

[Bug]: AttributeError: 'NoneType' object has no attribute 'get' after fast mode commit #7215

@zhangxiao918

Description

@zhangxiao918

Bug Description

After upgrading Hermes, Telegram messages trigger retries and eventually fail. Log shows:

File "/home/bluestome/.hermes/hermes-agent/run_agent.py", line 5522, in _build_api_kwargs
    fast_mode=self.request_overrides.get("speed") == "fast",
AttributeError: 'NoneType' object has no attribute 'get'

Steps to Reproduce

  1. Upgrade Hermes to a version containing commit 970192f1
  2. Send a message via Telegram
  3. Observe retry attempts in logs, followed by failure

Expected Behavior

Telegram messages should be processed normally without errors.

Actual Behavior

API call failed after 3 retries. 'NoneType' object has no attribute 'get'
...
File "/home/bluestome/.hermes/hermes-agent/run_agent.py", line 5522, in _build_api_kwargs
    fast_mode=self.request_overrides.get("speed") == "fast",
AttributeError: 'NoneType' object has no attribute 'get'

Affected Component

Other

Messaging Platform (if gateway-related)

Telegram

Operating System

Ubuntu 24.04

Python Version

3.11

Hermes Version

affected before commit c4137629 (revert)

Relevant Logs / Traceback

Root Cause Analysis (optional)

Commit 970192f1 (feat(gateway): add fast mode support to gateway chats) introduced self.request_overrides.get("speed") at line 5522 in run_agent.py. However, self.request_overrides is None in some code paths, even though __init__ sets self.request_overrides = dict(request_overrides or {}).

Proposed Fix (optional)

# run_agent.py line 5522
fast_mode=(self.request_overrides or {}).get("speed") == "fast",

Are you willing to submit a PR for this?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions