mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix: add iteration boundary linebreak to prevent stream concatenation
Cherry-picked from PR #2187 by @devorun. Fixes #2177. When streaming is enabled, text before and after tool calls gets concatenated without separation. Adds a paragraph break delta after _execute_tool_calls() so stream consumers insert proper whitespace between iteration boundaries.
This commit is contained in:
parent
dd39003a9b
commit
669c60a6bb
1 changed files with 3 additions and 0 deletions
|
|
@ -6732,6 +6732,9 @@ class AIAgent:
|
|||
_msg_count_before_tools = len(messages)
|
||||
self._execute_tool_calls(assistant_message, messages, effective_task_id, api_call_count)
|
||||
|
||||
# Signal iteration boundary to stream consumers to prevent text concatenation
|
||||
self._fire_stream_delta("\n\n")
|
||||
|
||||
# Refund the iteration if the ONLY tool(s) called were
|
||||
# execute_code (programmatic tool calling). These are
|
||||
# cheap RPC-style calls that shouldn't eat the budget.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue