mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix(cli): ensure single closure of streaming boxes during tool generation
- Updated `_on_tool_gen_start` method in `HermesCLI` to close open streaming boxes exactly once, preventing potential multiple closures. - Added a check for `_stream_box_opened` to manage the state of the streaming box more effectively, enhancing user experience during large payload streaming.
This commit is contained in:
parent
87e2626cf6
commit
4313b8aff6
1 changed files with 6 additions and 4 deletions
10
cli.py
10
cli.py
|
|
@ -4641,11 +4641,13 @@ class HermesCLI:
|
|||
def _on_tool_gen_start(self, tool_name: str) -> None:
|
||||
"""Called when the model begins generating tool-call arguments.
|
||||
|
||||
Closes any open streaming boxes (reasoning / response) and prints a
|
||||
short status line so the user sees activity instead of a frozen
|
||||
screen while a large payload (e.g. a 45 KB write_file) streams in.
|
||||
Closes any open streaming boxes (reasoning / response) exactly once,
|
||||
then prints a short status line so the user sees activity instead of
|
||||
a frozen screen while a large payload (e.g. 45 KB write_file) streams.
|
||||
"""
|
||||
self._flush_stream()
|
||||
if getattr(self, "_stream_box_opened", False):
|
||||
self._flush_stream()
|
||||
self._stream_box_opened = False
|
||||
self._close_reasoning_box()
|
||||
|
||||
from agent.display import get_tool_emoji
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue