refactor: streamline thinking spinner behavior in AIAgent

- Updated the logic for stopping the thinking spinner to improve clarity in tool execution messages.
- Removed unnecessary checks for tool calls, simplifying the spinner's stop behavior while maintaining informative output for users.
This commit is contained in:
teknium1
2026-02-19 01:56:04 -08:00
parent 109dffb242
commit 3f4b494c61

View File

@@ -2396,18 +2396,10 @@ class AIAgent:
api_duration = time.time() - api_start_time
# Stop thinking spinner -- defer "got it!" message for final text responses.
# For tool calls, stop silently since the tool execution messages are more informative.
# Stop thinking spinner silently -- the response box or tool
# execution messages that follow are more informative.
if thinking_spinner:
has_tool_calls = (
hasattr(response.choices[0].message, 'tool_calls')
and response.choices[0].message.tool_calls
)
if has_tool_calls:
thinking_spinner.stop("")
else:
face = random.choice(["(◕‿◕✿)", "ヾ(^∇^)", "(≧◡≦)", "✧٩(ˊᗜˋ*)و✧", "(*^▽^*)"])
thinking_spinner.stop(f"{face} ⚕ ready ({api_duration:.1f}s)")
thinking_spinner.stop("")
thinking_spinner = None
if not self.quiet_mode: