Skip to content

Commit 8ae5ca8

Browse files
authored
Update tui.py
1 parent ffc26ae commit 8ae5ca8

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

python_agent_harness/tui.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,19 @@ def _on_delta(self, text: str) -> None:
402402
# display without waiting for the next fixed tick
403403
self._data_event.set()
404404

405-
def _on_notify(self, kind: str) -> None:
406-
if kind == "tools":
405+
def _on_notify(self, kind: str, data: Any = None) -> None:
406+
if kind == "tool_start":
407+
# Tool execution is starting: clear the stale stream text
408+
# (the assistant message is committed to messages and will
409+
# appear in history once delivered) and show which tools are
410+
# running, so the display stays alive during long operations.
411+
with self.lock:
412+
self.stream_text = ""
413+
names = data if isinstance(data, list) else []
414+
label = ", ".join(names) if names else "tools"
415+
self.status = f" ⏳ {label}"
416+
self._history_dirty = True
417+
elif kind == "tools":
407418
self.status = " running tools"
408419
# tool round finished: session.last_messages now contains the
409420
# tool-call + result rows — rebuild the cached history so

0 commit comments

Comments
 (0)