Official codebase for CUAMaster: Scaling Computer-Use Agents through Open-World Recursive Improvement.
pip install -e ".[seeding,annotator,collection,dev]"
cp .env.example .env # fill in your API keys and sandbox service endpoints- Corpus harvesting —
cuamaster.seeding.harvestingretrieves instructional videos with taxonomy-driven compositional queries (configs/seeding/taxonomy.yaml, 8 domains / 36 subdomains / 650+ apps), then deduplicates and filters them. - Suitability scoring —
cuamaster.seeding.scoringtranscribes audio and scores CUA suitability with an annotator model (prompts/video_suitability_scoring.txt). - Seed task mining & dual-path reconstruction —
cuamaster.seeding.reconstructionsegments tasks and reconstructs trajectories by intersecting semantic triggers (transcript clauses) with visual triggers (frame-change detection) into a boundary lattice, then rechecks, annotates, and verifies them. - Primitive extraction & task synthesis —
cuamaster.propagationabstracts seed tasks into reusable ability primitives and composes them into verifiable tasks under explicit complexity control (K primitives, N applications). - Resilient trajectory collection —
cuamaster.collectionrolls out tasks in sandboxed environments with feedback-guided snapshot-rollback retries. The sandbox manager is exposed as a provider interface (cuamaster/collection/providers/); plug in your own VM/sandbox orchestration backend. - Model training —
scripts/prepare_*_sft.pyconvert verified trajectories into SFT datasets (ms-swift format); RL uses the task-specific verifiers for outcome-based rewards.
Every CLI below supports --help for the full option list. Installed console
commands (cuamaster-*) are available after pip install -e .; the
python -m forms work the same way.
# Search for candidate instructional videos (metadata only, no download).
python -m cuamaster.seeding.harvesting.search_cli \
--config configs/seeding/sources.example.yaml
# Download the selected videos (metadata JSONL in, mp4 files out).
python -m cuamaster.seeding.harvesting.download \
--inputs data/search_results/*.jsonl --out-dir data/videos
# Transcribe audio with faster-whisper (timestamped segments JSON).
python -m cuamaster.seeding.transcription.transcribe \
--input-dir data/videos --output-dir data/transcripts
# Score each video 0–5 for CUA suitability (prompts/video_suitability_scoring.txt).
python -m cuamaster.seeding.scoring.score \
--input-dir data/videos --transcript-dir data/transcripts \
--output-dir data/scores --backend openai --summarize
# Dual-path trajectory reconstruction: seed task mining, boundary lattice,
# action annotation, and trajectory verification in one pass.
# --input is the score-filtered video metadata JSONL (see cuamaster.seeding.cleaning).
python -m cuamaster.seeding.reconstruction.construct \
--config configs/seeding/reconstruction.example.yaml \
--input data/filtered_videos.jsonl --output-dir data/seed_taskscuamaster.seeding.cleaning (dedup / noise filtering / merging) and
cuamaster.seeding.rewriting (action rewriting) expose python -m CLIs in the
same style for post-processing reconstructed trajectories.
# Extract ability primitives, compose new tasks (K primitives × N apps),
# build task-level verifiers, and compile to executable benchmark format.
cuamaster-synthesize --config configs/propagation/example.yaml \
--output-dir data/generated_tasks# End-to-end smoke test without any VM: a mock runner that honors the
# collector's external-runner contract (see examples/mock_runner.py).
cuamaster-collect --config configs/collection/mock_command.example.json \
--output-root data/mock_collection
# Register / inspect versioned VM images used by the collector.
cuamaster-vm-images --store vm_images list
# Inspect versioned task specifications before a run.
cuamaster-tasks data/generated_tasks --require-evaluator
# Roll out tasks over the VM profile matrix with snapshot-rollback retries.
cuamaster-collect --config configs/collection/vm_matrix.example.json \
--output-root data/collection
# Export accepted episodes as an SFT-ready dataset.
cuamaster-dataset --collection-root data/collection --output-dir data/datasetThe collector talks to VMs through the SandboxProvider interface
(cuamaster/collection/providers/sandbox.py); wire in your own orchestration
via the provider registry, or use the generic command backend
(configs/collection/command_backend.example.json).
# Convert reconstructed seed trajectories into ms-swift SFT format.
python -m scripts.prepare_cua_swift_sft \
--cua-root data/seed_tasks --rank-paths data/scores --output-dir data/sft
# Convert collected trajectories (canonical runtime protocol) into SFT format.
python -m scripts.prepare_traj_collection_canonical_runtime_sft \
--root data/collection --output data/sft/collection.jsonl
# Merge trajectory directories without overwriting logical duplicates.
python -m scripts.merge_cua_datasets \
--primary data/seed_tasks --secondary data/seed_tasks_v2 --output data/mergedscripts/ also provides balanced sampling (sample_jsonl_balanced), dataset
splitting (split_swift_jsonl_by_image_group), and an end-to-end
task→trajectory driver (task_trajectory_pipeline).
from cuamaster.action_space import CUAAction, validate_action
from cuamaster.runtime import CanonicalEpisodeRunner, OpenAICompatibleModel
from cuamaster.benchmarks import INTERACTION_HARNESSES # GUI / CLI / hybrid modes
validate_action({"type": "computer.click", "args": {"x": 500, "y": 300}}) # [0,1000] coords@article{yu2026cuamaster,
title={CUA-Master: Scaling Computer-use Agents through Open-World Recursive Improvements},
author={Yu, Xinlei and Li, Gen and Zhao, Ji and Chen, Zhangquan and Wang, Congcong and Dong, Shuai and Peng, Zelin and Xu, Yuqi and Wu, Hongrui and Tuo, Kaiwen and Yang, Cheng and Feng, Kaituo and Wu, Yifan and Zhang, Jiayi and Wu, Dongming and Shao, Wenqi and Wang, Jiaqi and Yue, Xiangyu},
journal={arXiv preprint arXiv:2611.03126},
year={2026}
}We sincerely thank for the open-source code for OpenComputer, ScaleCUA and Weavebench.

