hermes - 💡(How to fix) Fix [Bug]: Agent turn ends with empty/partial reply after tools — user gets no explanation

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

Proposed direction: end-of-turn explanation from turn_exit_reason + recent retry/error context; optional live hint measured from the last visible token (paused during tool execution).

Additional Logs / Traceback (optional)

Root Cause

Root Cause Analysis (optional)

Fix Action

Fix / Workaround

What happened After substantive tool calls (read_file, patch, etc.), the agent turn sometimes ends with no usable assistant reply or only a truncated fragment (e.g. "The"), while the CLI/TUI response area looks empty or incomplete.

Steps to reproduce Use an OpenAI-compatible provider/model that occasionally returns empty or very short content after tool results (observed with GLM via DashScope; may vary by model/provider). Start a CLI or TUI session and ask the agent to modify a file (triggers read_file / patch). Let the agent run tools and wait for the final assistant message. Observe one of: Empty response box after tools completed successfully or with errors Partial text only (e.g. "The") then silence Turn ends with last message role tool and no follow-up assistant text Environment Hermes Agent: latest main (or specify your version) Interface: CLI / TUI (hermes --tui) Provider / model: e.g. DashScope + GLM-5.1 (adjust to your setup) OS: macOS Additional context turn_exit_reason values such as empty_response_exhausted / partial_stream_recovery exist internally but are not consistently explained to the user at end of turn. Gateway already rewrites (empty) to a generic message, but that does not cover partial streams or summarize retry/stream/tool context in one place. Proposed direction: end-of-turn explanation from turn_exit_reason + recent retry/error context; optional live hint measured from the last visible token (paused during tool execution).

  1. Configure an OpenAI-compatible provider that sometimes returns empty or truncated content after tool use (e.g. DashScope + glm-5.1).
  2. Run hermes (CLI) or hermes --tui.
  3. In a repo with an editable file, send: 请 read_file 查看 package.json,然后 patch 把某段文案改掉.
  4. Wait while the agent calls read_file and patch (tool activity appears in the feed).
  5. Observe the final turn:
    • Response box is empty, or
    • Only a partial fragment appears (e.g. The) and the turn ends, or
    • Tools finish but there is no summary of success/failure.
  6. Check ~/.hermes/logs/agent.log for the same session: look for turn_exit_reason=empty_response_exhausted, stream timeout, or 429 retries — the UI does not explain this to the user.

Code Example

Report       https://paste.rs/m5HKc
agent.log    https://paste.rs/LXV59
gateway.log  https://paste.rs/cKb5V

---
RAW_BUFFERClick to expand / collapse

Bug Description

What happened After substantive tool calls (read_file, patch, etc.), the agent turn sometimes ends with no usable assistant reply or only a truncated fragment (e.g. "The"), while the CLI/TUI response area looks empty or incomplete.

The user cannot tell whether:

the model is still thinking, the provider returned empty content, streaming was interrupted, a tool failed and the model stopped, or they should send "continue". During the turn, retry/status lines may appear briefly in the spinner/activity feed (e.g. empty-response retries), but at turn end there is often no consolidated explanation of why the agent stopped.

What I expected When a turn ends abnormally after tools (empty final response, partial stream, pending tool result, retries exhausted), Hermes should surface a clear, user-visible summary of why the reply stopped — similar in spirit to the file-mutation verifier footer, but for turn-completion failures.

Normal successful short replies (e.g. Done.) should not trigger warnings.

Steps to reproduce Use an OpenAI-compatible provider/model that occasionally returns empty or very short content after tool results (observed with GLM via DashScope; may vary by model/provider). Start a CLI or TUI session and ask the agent to modify a file (triggers read_file / patch). Let the agent run tools and wait for the final assistant message. Observe one of: Empty response box after tools completed successfully or with errors Partial text only (e.g. "The") then silence Turn ends with last message role tool and no follow-up assistant text Environment Hermes Agent: latest main (or specify your version) Interface: CLI / TUI (hermes --tui) Provider / model: e.g. DashScope + GLM-5.1 (adjust to your setup) OS: macOS Additional context turn_exit_reason values such as empty_response_exhausted / partial_stream_recovery exist internally but are not consistently explained to the user at end of turn. Gateway already rewrites (empty) to a generic message, but that does not cover partial streams or summarize retry/stream/tool context in one place. Proposed direction: end-of-turn explanation from turn_exit_reason + recent retry/error context; optional live hint measured from the last visible token (paused during tool execution).

Steps to Reproduce

  1. Configure an OpenAI-compatible provider that sometimes returns empty or truncated content after tool use (e.g. DashScope + glm-5.1).
  2. Run hermes (CLI) or hermes --tui.
  3. In a repo with an editable file, send: 请 read_file 查看 package.json,然后 patch 把某段文案改掉.
  4. Wait while the agent calls read_file and patch (tool activity appears in the feed).
  5. Observe the final turn:
    • Response box is empty, or
    • Only a partial fragment appears (e.g. The) and the turn ends, or
    • Tools finish but there is no summary of success/failure.
  6. Check ~/.hermes/logs/agent.log for the same session: look for turn_exit_reason=empty_response_exhausted, stream timeout, or 429 retries — the UI does not explain this to the user.

Expected Behavior

When a turn finishes after substantive tool calls, the user should always get one of:

  1. A complete assistant reply that summarizes what happened (including tool failures, if any), or
  2. A clear end-of-turn explanation when the model/provider did not produce a usable reply — for example:
    • empty content after retries (empty_response_exhausted)
    • streaming stopped early with only partial text (partial_stream_recovery)
    • the loop stopped while a tool result was still pending
    • iteration/budget limits were hit

That explanation should appear in the CLI/TUI response area (or as a trailing gateway message when the body was already streamed), not only as transient spinner/status text.

Normal successful turns should stay quiet: short intentional replies like Done. after successful tools must not trigger warnings.

Optional (nice-to-have): while still waiting for the next visible token after partial output, Hermes may show a live “still waiting” status measured from the last visible token (with the clock paused during tool execution).

Actual Behavior

After substantive tool calls (read_file, patch, etc.), the turn often ends without a usable assistant message:

  1. Empty response box — tools run (success or failure), but the CLI/TUI shows no final assistant text.
  2. Truncated output only — e.g. the stream shows The and then stops; no follow-up explanation.
  3. No end-of-turn summary — transient spinner/status lines may appear during retries (e.g. empty-response retry), but once the turn ends the user is left with blank or incomplete UI and no consolidated reason.

In ~/.hermes/logs/agent.log for the same session, internal diagnostics may show causes such as:

  • turn_exit_reason=empty_response_exhausted
  • partial_stream_recovery
  • provider stream timeout / 429 rate limit
  • tool errors (e.g. patch: Could not find old_string) without a final assistant summary

The user cannot tell whether to send "continue", change model/provider, or inspect tool output — the failure mode is silent from the UI perspective.

Example (observed):

  • User asks to edit a file after a workflow change.
  • Agent calls read_file successfully.
  • Response area stays empty, or shows only The before stopping.
  • No message explains that the model returned empty content, streaming stopped, or a tool failed.

Affected Component

Agent Core (conversation loop, context compression, memory), CLI (interactive chat)

Messaging Platform (if gateway-related)

No response

Debug Report

Report       https://paste.rs/m5HKc
agent.log    https://paste.rs/LXV59
gateway.log  https://paste.rs/cKb5V

Operating System

macOS 15.1.1

Python Version

3.11.14

Hermes Version

v0.14.0

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

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

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 [Bug]: Agent turn ends with empty/partial reply after tools — user gets no explanation