File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments