hermes - 💡(How to fix) Fix [Bug]: Partial Stream Misclassified as Clean Completion Causes Premature Loop Exit [2 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

A response recovery path triggered by its own warning (Partial stream delivered before error) should not proceed to finish_reason as stop.

Additional Logs / Traceback (optional)

Partial stream delivered before error; returning stub response with 109 chars of recovered

Root Cause

Root Cause Analysis (optional)

Fix Action

Fixed

Code Example

Report     https://paste.rs/Aqdgn
  agent.log  https://paste.rs/r6KIl

---

Loop exiting:
2026-05-23 01:46:58,027 WARNING [20260522_231914_daf959] agent.chat_completion_helpers:
Partial stream delivered before error; returning stub response with 109 chars of recovered
content to prevent duplicate messages: peer closed connection without sending complete
message body (incomplete chunked read)

2026-05-23 01:46:58,032 INFO [20260522_231914_daf959] agent.conversation_loop:
Turn ended: reason=text_response(finish_reason=stop) model=minimaxai/minimax-m2.7
api_calls=113/9999 budget=228/9999 tool_turns=112 last_msg_role=assistant
response_len=109 session=20260523_012013_a88716
  
Goal verdict after:
2026-05-23 01:47:08,565 INFO [20260522_231914_daf959] hermes_cli.goals:
goal judge: verdict=continue reason=The agent is only announcing it will run a batch
scan but has not yet produced any deliverables - no JSON list of 100+
RAW_BUFFERClick to expand / collapse

Bug Description

When the API connection drops mid-stream resulting in an incomplete chunked read, Hermes recovers partial content and classifies the response as text_response(finish_reason=stop), causing the agent loop to exit. Goal returns verdict as continue immediately after, but the loop has already terminated.

Steps to Reproduce

  1. Run Hermes
  2. Set a Goal
  3. provider-side TCP connection drops
  4. Hermes doesn't continue working on goal even if connection is possible to be restored

Expected Behavior

A response recovery path triggered by its own warning (Partial stream delivered before error) should not proceed to finish_reason as stop.

Actual Behavior

Partial stream with incomplete chunked read and no legitimate finish_reason from the API classified finish_reason as stop my loop exited with 228/9999 budget remaining.

Affected Component

Agent Core (conversation loop, context compression, memory)

Messaging Platform (if gateway-related)

No response

Debug Report

Report     https://paste.rs/Aqdgn
  agent.log  https://paste.rs/r6KIl

Operating System

Debian 13.4.0 64x

Python Version

Python 3.11.2

Hermes Version

Hermes Agent v0.14.0 (2026.5.16)

Additional Logs / Traceback (optional)

Loop exiting:
2026-05-23 01:46:58,027 WARNING [20260522_231914_daf959] agent.chat_completion_helpers:
Partial stream delivered before error; returning stub response with 109 chars of recovered
content to prevent duplicate messages: peer closed connection without sending complete
message body (incomplete chunked read)

2026-05-23 01:46:58,032 INFO [20260522_231914_daf959] agent.conversation_loop:
Turn ended: reason=text_response(finish_reason=stop) model=minimaxai/minimax-m2.7
api_calls=113/9999 budget=228/9999 tool_turns=112 last_msg_role=assistant
response_len=109 session=20260523_012013_a88716
  
Goal verdict after:
2026-05-23 01:47:08,565 INFO [20260522_231914_daf959] hermes_cli.goals:
goal judge: verdict=continue reason=The agent is only announcing it will run a batch
scan but has not yet produced any deliverables - no JSON list of 100+

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]: Partial Stream Misclassified as Clean Completion Causes Premature Loop Exit [2 pull requests]