Skip to content

Navi agent generates incorrect method signature for computer.mouse.drag() causing 500 errors #79

@abrichr

Description

@abrichr

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

  1. Run WAA benchmark with Navi agent (GPT-4o)
  2. Wait for a task that requires a drag operation
  3. LLM generates: computer.mouse.drag(x=0.71, y=0.58)
  4. Server executes via exec(command)
  5. Python raises: TypeError: drag() got unexpected keyword argument 'x'
  6. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions