-
Notifications
You must be signed in to change notification settings - Fork 91
Description
Description
The Navi agent generates Python code with incorrect keyword argument names for computer.mouse.drag(), causing HTTP 500 errors during task execution.
Root Cause: Keyword Argument Name Mismatch
The system prompt in planner_messages.py documents the drag function with keyword arguments x= and y=:
computer.mouse.drag(x=0.35, y=0.48) # Drags the mouse from the current position to the specified position.But the actual function signature in computer.py uses different parameter names (screen_x and screen_y):
def drag(self, screen_x, screen_y):
pyautogui.dragTo(screen_x, screen_y, button='left')In Python, keyword argument names must match parameter names exactly:
# This WORKS (positional arguments):
drag(0.35, 0.48)
# This WORKS (keyword args matching parameter names):
drag(screen_x=0.35, screen_y=0.48)
# This FAILS (keyword args NOT matching parameter names):
drag(x=0.35, y=0.48)
# TypeError: drag() got unexpected keyword argument 'x'Because the documentation shows x= and y=, the LLM generates code using those keyword names. But the function expects screen_x= and screen_y=, so Python raises a TypeError and the server returns HTTP 500.
Steps to Reproduce
- Run WAA benchmark with Navi agent (GPT-4o)
- Wait for a task that requires a drag operation
- LLM generates:
computer.mouse.drag(x=0.71, y=0.58) - Server executes via
exec(command) - Python raises:
TypeError: drag() got unexpected keyword argument 'x' - Server returns HTTP 500
Error Message
TypeError: drag() got unexpected keyword argument 'x'
Expected Behavior
The documentation should match the implementation so LLM-generated code executes successfully.
Proposed Fix
Option A: Update documentation to use positional arguments (recommended)
In planner_messages.py, change:
# Before:
computer.mouse.drag(x=0.35, y=0.48)
# After:
computer.mouse.drag(0.35, 0.48) # Drags from current position to normalized (x, y)Option B: Update implementation to accept the documented keyword names
In computer.py, change:
# Before:
def drag(self, screen_x, screen_y):
# After:
def drag(self, x, y):
pyautogui.dragTo(x, y, button='left')Environment
- QEMU: 10.0.6
- WAA Docker image:
windowsarena/winarena:latest - Agent: Navi with GPT-4o
Additional Context
- This affects all drag operations generated by the Navi agent
- Issue Failed to execute command. Status code: 500 #49 reports similar 500 errors but the root cause there was QEMU version mismatch (different issue)
- Neither
planner_messages.pynorcomputer.pyhas been modified since the initial release