hermes - ✅(Solved) Fix bug: literal (empty) string sent to users when model returns no content [1 pull requests, 1 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#11539Fetched 2026-04-18 06:00:24
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×1

Error Message

Replace the (empty) sentinel with descriptive error messages:

Fix Action

Fixed

PR fix notes

PR #11563: bug: literal (empty) string sent to users when model returns no content

Description (problem / solution / changelog)

Closes #11539

Summary

  • Replace the internal (empty) sentinel with user-facing fallback text that distinguishes reasoning-only replies from fully empty replies.
  • Preserve backward compatibility in the gateway so legacy (empty) results still display correctly and do not get suppressed when streaming already sent partial text.
  • Add regression tests for the new fallback messaging and gateway detection logic.

Changed files

  • gateway/run.py (modified, +46/-20)
  • run_agent.py (modified, +18/-2)
  • tests/gateway/test_empty_response_handling.py (added, +47/-0)
  • tests/run_agent/test_run_agent.py (modified, +22/-5)

Code Example

File unchanged since last read. The content from the earlier read_file result in this conversation is still current — refer to that instead of re-reading.
RAW_BUFFERClick to expand / collapse

Bug

When the model returns empty content (no text, only reasoning, or nothing at all), run_agent.py sets final_response to the literal string (empty) which is then sent to users verbatim — confusing and unhelpful.

Steps to Reproduce

  1. Use a model that occasionally returns reasoning-only responses (no visible text)
  2. The user receives a message containing just (empty)

Suggested Fix

Replace the (empty) sentinel with descriptive error messages:

  • Reasoning-only: explain that the model produced internal reasoning but no visible response
  • Fully empty: explain the model returned no content, suggest trying again

Also add a defensive catch in gateway/run.py for both the main response path and background agent path.

<details> <summary>Reference diff (from justmaker fork, will need porting to current main)</summary>
File unchanged since last read. The content from the earlier read_file result in this conversation is still current — refer to that instead of re-reading.
</details>

extent analysis

TL;DR

Replace the (empty) sentinel in run_agent.py with descriptive error messages to improve user experience when the model returns empty content.

Guidance

  • Identify the conditions under which the model returns empty content, such as reasoning-only responses or fully empty responses, to provide accurate error messages.
  • Modify run_agent.py to set final_response to a descriptive error message instead of (empty), depending on the type of empty content returned by the model.
  • Add defensive catches in gateway/run.py for both the main response path and background agent path to handle empty content scenarios.
  • Test the updated run_agent.py and gateway/run.py with different types of model responses to ensure the error messages are correctly displayed to users.

Example

if model_response == "":
    final_response = "The model returned no content. Please try again."
elif model_response == "reasoning_only":
    final_response = "The model produced internal reasoning but no visible response."

Notes

The provided diff is from a different fork and needs to be ported to the current main branch. The exact implementation may vary depending on the specific requirements and constraints of the project.

Recommendation

Apply workaround: Replace the (empty) sentinel with descriptive error messages and add defensive catches in gateway/run.py to improve user experience and handle empty content scenarios.

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