OSWorld
June 2, 2025 ยท View on GitHub
Setup
- Clone the original OSWorld repository:
git clone https://github.com/xlang-ai/OSWorld.git
-
Follow the configuration steps in the original repository to set up the environment and dependencies. We use Docker to support the virtual machine.
-
For online training, we deploy the OSWorld environment on a dedicated machine. The environment interface is exposed as an API via
env_api_wrapper.pyfor remote access by the agent. Multiple environment instances are managed in parallel usingenv_api_manager.py. To launch the environment instances, simply place these two files in the OSWorld directory and run:
python env_api_manager.py
Task Generation
Initial Screenshot Generation
To generate your first screenshot for task generation:
- Run OSWorld with any agent of your choice. If you don't want to execute any agent actions, you can set the agent's step count to 0.
- This will create the initial screenshot needed for task generation.
Task Generation Configuration
Before running the task generation script, you need to configure the following parameters in task_generation.py:
- OpenAI API Key
- Result directory path (location of screenshots, e.g.,
./result/agent/pyautogui/screenshot/gpt-4o) - Save directory path (default:
./generated_examples/examples, must matchexamples_dirintask_generation_meta.py) - Option to generate infeasible tasks
In task_generation_meta.py, the percentage parameter determines the proportion of tasks that will be randomly selected for the final task set.
Generating Tasks
Once everything is configured:
- Run the task generation script:
python task_generation.py
This will process your screenshots and generate task descriptions in the specified output directory.
- Run the task metadata generation script:
python task_generation_meta.py
The generated task JSON file will be saved as generated_examples/test_all.json, which can be used for training or testing in OSWorld.