Skip to content

[Bug]: Live Demo Code Snippet Error: TypeError: CompositionalTask.cheat() missing 1 required positional argument: 'subtask_idx' #62

@brendanm12345

Description

@brendanm12345

Browsergym Version

0.4.1

Playwright Version

1.50.0

Operating System Type

macOS

Operating System Version

macOS 14 (Sonoma)

Affected Browsers

Chromium

What happened?

  1. I set up my service now instance and ran the live demo code snippet to see WorkArena in action
  2. I observed the following error
Task: <class 'browsergym.workarena.tasks.compositional.WorkAssignmentSmallTaskL2'>
Traceback (most recent call last):
  File "/[REDACTED]/bm/test.py", line 19, in <module>
    env.task.cheat(env.page, cheat_messages)
TypeError: CompositionalTask.cheat() missing 1 required positional argument: 'subtask_idx'
  1. I noticed that:
  • AbstractBrowserTask.cheat() takes 2 parameters: (self, page, chat_messages)
  • CompositionalTask.cheat() takes 3 parameters: (self, page, chat_messages, subtask_idx)

Proposed solution:

  1. Add subtask_idx parameter to the parent class with a default value of None:

Reproduction Steps

  1. Follow the steps in part a and b of README.md
  2. Create a file called test.py in the root directory and paste the code snippet from the Live Demo section of README.md
  3. Run the file using python3 test.py

Relevant Logs

Task: <class 'browsergym.workarena.tasks.compositional.WorkAssignmentSmallTaskL2'>
Traceback (most recent call last):
  File "/[REDACTED]/bm/test.py", line 19, in <module>
    env.task.cheat(env.page, cheat_messages)
TypeError: CompositionalTask.cheat() missing 1 required positional argument: 'subtask_idx'

Additional Context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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