Skip to content

Commit 15ccc1f

Browse files
committed
fix duplicated render issue with console live
1 parent 2f7347f commit 15ccc1f

File tree

4 files changed

+6
-13
lines changed

4 files changed

+6
-13
lines changed

AgentCrew/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.6.21"
1+
__version__ = "0.6.21-1"

AgentCrew/modules/console/ui_effects.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ def __init__(self, console: Console, message_handler: MessageHandler):
2222
"""Initialize UI effects with a console instance."""
2323
self.console = console
2424
self.live = None
25-
self._live_text_data = ""
2625
self._loading_stop_event = None
2726
self._loading_thread = None
2827
self.message_handler = message_handler
@@ -75,10 +74,10 @@ def stop_loading_animation(self):
7574
"""Stop the loading animation."""
7675
if self._loading_stop_event:
7776
self._loading_stop_event.set()
77+
self._loading_stop_event = None
7878
if self._loading_thread and self._loading_thread.is_alive():
7979
self._loading_thread.join(timeout=0.5)
80-
self._loading_stop_event = None
81-
self._loading_thread = None
80+
self._loading_thread = None
8281

8382
def start_streaming_response(self, agent_name: str):
8483
"""Start streaming the assistant's response."""
@@ -88,9 +87,7 @@ def start_streaming_response(self, agent_name: str):
8887
self.console.print(
8988
Text(f"🤖 {agent_name.upper()}:", style=RICH_STYLE_GREEN_BOLD)
9089
)
91-
self.live = Live(
92-
"", console=self.console, refresh_per_second=24, vertical_overflow="crop"
93-
)
90+
self.live = Live("", console=self.console, vertical_overflow="crop")
9491
self.live.start()
9592

9693
def update_live_display(self, chunk: str):
@@ -99,10 +96,6 @@ def update_live_display(self, chunk: str):
9996
self.start_streaming_response(self.message_handler.agent.name)
10097

10198
updated_text = chunk
102-
if self._live_text_data == updated_text:
103-
# Skip if no change
104-
return
105-
self._live_text_data = updated_text
10699

107100
# Only show the last part that fits in the console
108101
lines = updated_text.split("\n")

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "agentcrew-ai"
3-
version = "0.6.21"
3+
version = "0.6.21-1"
44
requires-python = ">=3.12"
55
classifiers = [
66
"Programming Language :: Python :: 3",

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)