mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-10-20 05:15:31 +00:00
fix(cli): enhance real-time reasoning output by forcing flush of long partial lines
Updated the reasoning output mechanism to emit complete lines and force-flush long partial lines, ensuring reasoning is visible in real-time even without newlines. This improves user experience during reasoning sessions.
This commit is contained in:
parent
7cdf4efe05
commit
0f3c191ef1
1 changed files with 5 additions and 1 deletions
6
cli.py
6
cli.py
|
|
@ -1509,10 +1509,14 @@ class HermesCLI:
|
|||
|
||||
self._reasoning_buf = getattr(self, "_reasoning_buf", "") + text
|
||||
|
||||
# Emit complete lines
|
||||
# Emit complete lines, and force-flush long partial lines so
|
||||
# reasoning is visible in real-time even without newlines.
|
||||
while "\n" in self._reasoning_buf:
|
||||
line, self._reasoning_buf = self._reasoning_buf.split("\n", 1)
|
||||
_cprint(f"{_DIM}{line}{_RST}")
|
||||
if len(self._reasoning_buf) > 80:
|
||||
_cprint(f"{_DIM}{self._reasoning_buf}{_RST}")
|
||||
self._reasoning_buf = ""
|
||||
|
||||
def _close_reasoning_box(self) -> None:
|
||||
"""Close the live reasoning box if it's open."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue