@@ -64,6 +64,7 @@ func _ready() -> void:
6464 expand_button .button_pressed = auto_expand_think
6565 set_expand_icon_flip (auto_expand_think )
6666 think_content_panel .visible = auto_expand_think
67+ set_process (false )
6768
6869func _process (delta : float ) -> void :
6970 if thinking :
@@ -77,6 +78,8 @@ func update_think_content(text: String, start_timer: bool = true):
7778 return
7879
7980 thinking = start_timer
81+ if start_timer and show_think :
82+ set_process (true )
8083 think_container .show ()
8184 # 去除首尾空白和换行,避免RichTextLabel渲染出过大高度
8285 think_content .text = text .strip_edges ()
@@ -86,6 +89,7 @@ func update_think_content(text: String, start_timer: bool = true):
8689func update_message_content (text : String ):
8790 message_type = MessageType .AssistantMessage
8891 thinking = false
92+ set_process (false )
8993 if show_think :
9094 thinking_label .text = "思考了"
9195 # 去除首尾空白和换行,避免RichTextLabel渲染出过大高度
@@ -122,6 +126,7 @@ func used_tools(tool_calls: Array):
122126 message_type = MessageType .ToolMessage
123127 wait_using_tool .hide ()
124128 thinking = false
129+ set_process (false )
125130 for tool in tool_calls :
126131 var use_tool_item = USE_TOOL_ITEM .instantiate ()
127132 use_tool_container .add_child (use_tool_item )
@@ -149,6 +154,7 @@ func on_click_rich_text_url(meta):
149154func update_error_message (error_content : String , detail ):
150155 message_type = MessageType .ErrorMessage
151156 thinking = false
157+ set_process (false )
152158 use_tool_container .hide ()
153159 wait_using_tool .hide ()
154160 think_content_panel .hide ()
@@ -164,6 +170,8 @@ func update_finished_message(type: String):
164170 if type == "Stop" :
165171 stop_message .show ()
166172 thinking = false
173+ set_process (false )
167174 elif type == "Success" :
168175 success_message .show ()
169176 thinking = false
177+ set_process (false )
0 commit comments