hermes - ✅(Solved) Fix [Bug]: /queue broken — 'SendResult' object has no attribute 'get' in gateway _run_agent [1 pull requests, 2 comments, 2 participants]

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…
GitHub stats
NousResearch/hermes-agent#25152Fetched 2026-05-14 03:48:30
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×4commented ×2cross-referenced ×1

Error Message

2026-05-13 18:41:20,509 ERROR gateway.run: Agent error in session agent:main:telegram:dm:1082168528 Traceback (most recent call last): File "gateway/run.py", line 6783, in _handle_message_with_agent agent_result = await self._run_agent(...) File "gateway/run.py", line 14960, in _run_agent updated_history = result.get("messages", history) ^^^^^^^^^^ AttributeError: 'SendResult' object has no attribute 'get'

Root Cause

In gateway/run.py line 14960, _run_agent method:

updated_history = result.get("messages", history)

result is a SendResult object (from gateway/platforms/base.py:986), not a dict. SendResult has attributes success, message_id, error but no .get() method.

Fix Action

Fixed

PR fix notes

PR #25161: fix(gateway): guard against non-dict agent results in /queue path

Description (problem / solution / changelog)

Summary

Fixes a crash when /queue encounters a non-dict result from run_conversation.

Root cause: gateway/run.py assumes result_holder[0] is always a dict and calls .get() on it in 7 places. If run_conversation returns a SendResult (or any non-dict), this crashes with AttributeError.

Fix: Add a defensive isinstance(result, dict) guard right after reading result_holder[0]. Non-dict values are replaced with {"final_response": "", "messages": []} so all downstream .get() calls proceed safely.

Testing: 7 new tests covering SendResult, None, string, and normal dict results. All existing tests pass.

Closes #25152

Changed files

  • gateway/run.py (modified, +5/-0)
  • tests/run_agent/test_queue_sendresult_guard.py (added, +139/-0)

Code Example

'SendResult' object has no attribute 'get'

---

updated_history = result.get("messages", history)

---

2026-05-13 18:41:20,509 ERROR gateway.run: Agent error in session agent:main:telegram:dm:1082168528
Traceback (most recent call last):
  File "gateway/run.py", line 6783, in _handle_message_with_agent
    agent_result = await self._run_agent(...)
  File "gateway/run.py", line 14960, in _run_agent
    updated_history = result.get("messages", history)
                      ^^^^^^^^^^
AttributeError: 'SendResult' object has no attribute 'get'

---

# Line 14960 — guard against SendResult
if isinstance(result, SendResult):
    updated_history = history  # or get messages from SendResult if available
elif isinstance(result, dict):
    updated_history = result.get("messages", history)
else:
    updated_history = history
RAW_BUFFERClick to expand / collapse

Bug Description

Using /queue in Telegram returns an AttributeError:

'SendResult' object has no attribute 'get'

Steps to Reproduce

  1. Send /queue <any prompt> via Telegram
  2. Agent processes the queued message
  3. Gateway crashes with AttributeError

Root Cause

In gateway/run.py line 14960, _run_agent method:

updated_history = result.get("messages", history)

result is a SendResult object (from gateway/platforms/base.py:986), not a dict. SendResult has attributes success, message_id, error but no .get() method.

Expected Behavior

Queue should work — prompt gets queued, agent processes it, result delivered.

Environment

  • Hermes Agent: v2026.5.7 (installed from main)
  • OS: macOS (Apple Silicon)
  • Platform: Telegram gateway
  • Model: deepseek-v4-pro (fallback, primary Codex token consumed)

Error Log

2026-05-13 18:41:20,509 ERROR gateway.run: Agent error in session agent:main:telegram:dm:1082168528
Traceback (most recent call last):
  File "gateway/run.py", line 6783, in _handle_message_with_agent
    agent_result = await self._run_agent(...)
  File "gateway/run.py", line 14960, in _run_agent
    updated_history = result.get("messages", history)
                      ^^^^^^^^^^
AttributeError: 'SendResult' object has no attribute 'get'

Suggested Fix

# Line 14960 — guard against SendResult
if isinstance(result, SendResult):
    updated_history = history  # or get messages from SendResult if available
elif isinstance(result, dict):
    updated_history = result.get("messages", history)
else:
    updated_history = history

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 - ✅(Solved) Fix [Bug]: /queue broken — 'SendResult' object has no attribute 'get' in gateway _run_agent [1 pull requests, 2 comments, 2 participants]