microsoft / UFO

A UI-Focused Agent for Windows OS Interaction.
https://arxiv.org/abs/2402.07939
MIT License
7.93k stars 1.06k forks source link

AttributeError: 'AppAgentProcessor' object has no attribute 'update_step'. Did you mean: 'update_cost'? #129

Open HamzaAsiff opened 3 weeks ago

HamzaAsiff commented 3 weeks ago

I tried setting up and running the UFO first time with a basic task of sending an email to a gmail address with a simple question. UFO does everything as expected until the last step when it asks the user for permission to send the email. That's where I received the error. Full traceback is pasted below:

[Input Required:] UFO🛸 will apply click_input(button='left', double=False) on the [Send] item. Please confirm whether to proceed or not. Please input Y or N. Y Traceback (most recent call last): File "C:\Users\anaconda3\envs\ufo\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\anaconda3\envs\ufo\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Users\code\UFO\ufo__main__.py", line 7, in ufo.main() File "C:\Users\code\UFO\ufo\ufo.py", line 56, in main clients.run_all() File "C:\Users\code\UFO\ufo\module\client.py", line 28, in run_all session.run() File "C:\Users\code\UFO\ufo\module\sessions\session.py", line 103, in run super().run() File "C:\Users\code\UFO\ufo\module\basic.py", line 355, in run round.run() File "C:\Users\code\UFO\ufo\module\basic.py", line 104, in run self.agent.handle(self.context) File "C:\Users\code\UFO\ufo\agents\agent\basic.py", line 224, in handle self.state.handle(self, context) File "C:\Users\code\UFO\ufo\agents\states\app_agent_state.py", line 315, in handle agent.process_resume() File "C:\Users\code\UFO\ufo\agents\agent\basic.py", line 237, in process_resume self.processor.resume() File "C:\Users\code\UFO\ufo\agents\processors\basic.py", line 152, in resume self.update_step() AttributeError: 'AppAgentProcessor' object has no attribute 'update_step'. Did you mean: 'update_cost'?

Currently on Windows 11 using Anaconda Virtual Env with python 3.10.15 Also tried python 3.13 but same error. Any assistance would be appreciated, thanks

vyokky commented 3 weeks ago

Hi @HamzaAsiff , thanks for reporting this issue. We have fixed it in our dev version: https://github.com/microsoft/UFO/tree/vyokky/dev Please have a try and let us know if there is any issue. Thanks!

HamzaAsiff commented 3 weeks ago

Hello, thanks for the quick response. I have tried the dev version and it fixed that particular issue so will be closing this issue. But I have noticed some more issues while executing a request of sending an email:

  1. UFO throws an error while executing the same request which worked previously with no changes in the prompt.
  2. UFO sometimes goes into a loop of executing a same local plan again and again. For example In the user confirmation section to send an email it asked the user to confirm multiple times even after getting the user input the first time.
  3. Safeguard feature doesn't always work. For example in the task of sending an email, in the first session it asked the user to provide confirmation before sending the email. But in another session with a slight change in the prompt it sent the email and asked for confirmation after sending it.

Currently on Windows 11 using Anaconda Virtual Env with python 3.10.15 Also tried python 3.13.

vyokky commented 3 weeks ago

@HamzaAsiff What is the error trace it throws you encounter?

HamzaAsiff commented 3 weeks ago

This is the error traceback when I asked it to analyze and explain the an image. I got the same issue when sending an email which somehow worked the second time with no changes in prompt:

Please enter your request to be completed🛸: Analyse and explain the RagArchitecture.png image. Round 1, Step 1, HostAgent: Analyzing the user intent and decomposing the request... Observations👀: I observe that the RagArchitecture.png image is currently open in the screenshot, indicating that I can analyze its content directly. The Outlook application is also visible, which may be relevant for future tasks, but the current focus is on the image analysis. Thoughts💡: The user request can be solely completed by analyzing the RagArchitecture.png image. I need to focus on extracting relevant information from this image and providing an explanation based on its content. Plans📚: (1) Analyze the content of the RagArchitecture.png image and provide an explanation of its elements and structure. Next Selected application📲: RagArchitecture.png Messages to AppAgent📩: (1) Carefully examine the image to identify key components and their relationships. (2) Summarize the findings in a clear and concise manner. Status📊: CONTINUE Comment💬: I will now proceed to analyze the RagArchitecture.png image and provide an explanation based on its content. Opening the required application or file... Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "C:\Users\Hamza\OneDrive\Desktop\code\UFO-vyokky-dev\ufo__main__.py", line 7, in ufo.main() File "C:\Users\Hamza\OneDrive\Desktop\code\UFO-vyokky-dev\ufo\ufo.py", line 66, in main clients.run_all() File "C:\Users\Hamza\OneDrive\Desktop\code\UFO-vyokky-dev\ufo\module\client.py", line 28, in run_all session.run() File "C:\Users\Hamza\OneDrive\Desktop\code\UFO-vyokky-dev\ufo\module\sessions\session.py", line 122, in run super().run() File "C:\Users\Hamza\OneDrive\Desktop\code\UFO-vyokky-dev\ufo\module\basic.py", line 362, in run round.run() File "C:\Users\Hamza\OneDrive\Desktop\code\UFO-vyokky-dev\ufo\module\basic.py", line 104, in run self.agent.handle(self.context) File "C:\Users\Hamza\OneDrive\Desktop\code\UFO-vyokky-dev\ufo\agents\agent\basic.py", line 224, in handle self.state.handle(self, context) File "C:\Users\Hamza\OneDrive\Desktop\code\UFO-vyokky-dev\ufo\agents\states\host_agent_state.py", line 132, in handle agent.process(context) File "C:\Users\Hamza\OneDrive\Desktop\code\UFO-vyokky-dev\ufo\agents\agent\host_agent.py", line 241, in process self.processor.process() File "C:\Users\Hamza\OneDrive\Desktop\code\UFO-vyokky-dev\ufo\agents\processors\basic.py", line 122, in process self.execute_action() File "C:\Users\Hamza\OneDrive\Desktop\code\UFO-vyokky-dev\ufo\agents\processors\basic.py", line 164, in wrapper result = func(self, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Hamza\OneDrive\Desktop\code\UFO-vyokky-dev\ufo\agents\processors\host_agent_processor.py", line 169, in execute_action new_app_window = self.host_agent.app_file_manager(self.app_to_open) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Hamza\OneDrive\Desktop\code\UFO-vyokky-dev\ufo\agents\agent\host_agent.py", line 218, in app_file_manager results = file_manager.execute_code(app_file_info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Hamza\OneDrive\Desktop\code\UFO-vyokky-dev\ufo\automator\ui_control\openfile.py", line 50, in execute_code self.APP = args.get("APP", "") ^^^^^^^^ AttributeError: 'str' object has no attribute 'get'

vyokky commented 3 weeks ago

We now fix this error at the same branch, please pull the latest code. For issue 2 and 3, we are working on it. Thanks your report :)

HamzaAsiff commented 3 weeks ago

I pulled the latest code and tried it. The errors are resolved now for the queries I tried before. Regarding the looping issue, I noticed that ufo does manage to create the plan and prepare the content but it loops over at the stage when It has to perform the action part. For example in the email sending part, I noticed that it can understand the image and compose the email content accurately but when it comes to actually select the new email button or when writing in the outlook, that's where it loops over. I also tried to increase the windows scale up to 150% but that didn't help as well. Hope this gives more info regarding the issue, thanks.

Zhang-Henry commented 3 weeks ago

I have encountered the same problem of looping over the same action. Wish to be solved. Thanks!

vyokky commented 5 hours ago

@Zhang-Henry Please try the branch https://github.com/microsoft/UFO/tree/vyokky/dev