Adaptive Cross-Device Execution through Stateful Control.
Official code and CAPEBench release for OctoNest: Adaptive Cross-Device Execution through Stateful Control.
Paper · PDF · Deployment guide · Citation
OctoNest is a computer-use framework for tasks spanning phones, personal computers, and remote machines. It coordinates API, CLI, and GUI execution while distinguishing a failed modality from a device that can no longer complete its subtask. As execution reveals new constraints, OctoNest adapts locally when possible and reassigns work across devices when necessary.
OctoNest separates global orchestration state from device-local modality state. The left path escalates a device-level failure; the right path handles a modality-level failure within the same device.
OctoNest uses two connected control loops to preserve task progress under changing execution conditions:
- Device-local control: a Device Agent tracks local progress and observed constraints, refines its assigned subtask, and selects or combines API, CLI, and GUI executors. If one modality becomes unavailable but another remains feasible, it switches within the device.
- Cross-device orchestration: the Orchestrator tracks the task plan, dependencies, completed work, and device feasibility. When a Device Agent cannot find a viable local continuation, it returns execution evidence; the Orchestrator revises the remaining plan and device assignments.
An expired API token, for example, may still allow GUI execution on the same machine. A device-wide network disconnection can instead require moving a network-dependent subtask to another device. The distinction is learned from execution feedback rather than assumed at planning time.
CAPEBench (Cross-device Adaptation to Perturbations in Execution) tests whether agents recognize interaction-revealed changes in device and modality feasibility and switch at the appropriate level. This release expands 23 cross-device seed tasks deterministically into the 158 variants evaluated in the paper:
| Condition | Variants |
|---|---|
| No perturbation | 23 |
| Device-level perturbation | 36 |
| Modality-level perturbation | 42 |
| Mixed perturbation | 57 |
| Total | 158 |
Modality-level perturbations test intra-device switching, device-level perturbations test inter-device switching, and mixed perturbations test both. Tasks span Gmail, Google Drive, Google Calendar, GitHub, Linux CLI, and Android/Linux GUI execution. Perturbations include session invalidation, network loss, API unavailability, permission and scope failures, and missing CLI tools.
Key dataset files:
seed_tasks_v2.yaml: task instructions, evaluator-only step structure, and perturbation points.seed_env_init_v2.yaml: deterministic environment setup and postcondition checks.variants_preview.jsonl: the canonical static expansion of the 23 seeds.env_contract.yaml: evaluation and fault semantics.paper_annotations: manually reviewed benchmark annotations used by the analysis code.
Regenerate the static variant preview with:
python replan_lab/dataset_builder/expand_variants.pyThe command should produce 158 variants with the counts shown above. Formal evaluations render run-local copies of the seed and environment specifications and do not consume the repository preview as runtime input. Task and environment times use UTC, preserving the same instants as the original Asia/Shanghai specifications.
This open-source release contains the benchmark definitions and implementation, but no experiment episodes, model conversations, device-action traces, screenshots, or runtime logs. Those records belong to the separate submission supplementary artifact.
Legacy internal filenames and schema identifiers may retain the mutbench stem for stable references; the dataset's public name is CAPEBench.
On the Full-158 evaluation, OctoNest improves Completion, Adherence, and Perfect Pass by 10.51, 11.36, and 18.35 percentage points, respectively, over UFO³-Hybrid, the strongest baseline. Its token cost per perfect pass is 39.8% lower. Further analysis shows more capability-compatible modality sequences and stronger affected-step recovery under perturbations.
Full-158 results from Table 1 of the paper (arXiv v2):
| Method | Execution | Completion (%) ↑ | Adherence (%) ↑ | Perfect Pass (%) ↑ | Tokens/Episode ↓ | Tokens/Perfect Pass ↓ |
|---|---|---|---|---|---|---|
| CRAB | GUI | 2.37 | 16.19 | 0.00 | 545,102 | ∞ |
| CRAB | API | 22.95 | 38.39 | 0.00 | 513,463 | ∞ |
| TopoClaw | Hybrid | 46.86 | 52.17 | 5.70 | 933,484 | 16,387,826 |
| UFO³ | GUI | 47.06 | 50.94 | 10.13 | 1,452,661 | 14,345,029 |
| UFO³ | API | 59.28 | 65.44 | 0.00 | 426,608 | ∞ |
| UFO³ | Hybrid | 65.00 | 65.46 | 22.78 | 702,893 | 3,084,917 |
| OctoNest | Hybrid | 75.51 | 76.82 | 41.14 | 764,552 | 1,858,449 |
Tokens/Perfect Pass includes tokens spent on unsuccessful episodes. The paper's architectural ablations use a separate 82-instance sample.
aip/ Agent communication protocol and transport
galaxy/ OctoNest orchestration and device coordination
ufo/ Upstream-compatible device-agent implementation
replan_lab/ CAPEBench, evaluation pipeline, baselines, and controllers
config/ Model, device, relay, and evaluation configuration
desktop_env/ Desktop environment providers and controllers
tests/ Unit and integration tests
The Python import paths ufo and galaxy are intentionally retained for compatibility with the upstream framework and existing artifacts. They are implementation-level module names; the public system name is OctoNest. Baseline identifiers containing ufo3 likewise refer to the upstream UFO³ baseline and are not renamed.
OctoNest currently supports Python 3.10 and 3.11.
With uv:
uv syncOr with a virtual environment and pip:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtCopy the environment template and provide credentials only in your local .env file:
cp .env.example .envNever commit .env, OAuth tokens, browser profiles, or service credentials.
Start with the deployment and benchmark guide for Google OAuth and GitHub permissions, Linux Firefox profiles, Android login snapshots, service configuration, and preflight checks. The steps below summarize the reference deployment.
The reference topology uses two Linux desktops and two Android emulators. The main host runs the Orchestrator, relay, four device WebSocket servers, and their device-agent clients; it also runs the two Android emulators and controllers. Each Linux desktop runs its own CLI MCP server, GUI MCP server, and perturbation controller. The machines must be able to reach each other on a trusted network; these services have no built-in authentication.
-
Install the same repository revision on the main host and both Linux desktops. Install Python dependencies as above. On the main host, install Android SDK/ADB and create two emulators; on each Linux desktop, provide an X11 desktop, Firefox,
xclip, and the controller's required system tools. -
Fill in
.envwith model credentials, dedicated CAPEBench GitHub/Google API credentials, Linux host addresses, and Android serials. Separately sign in to GitHub and Google in the Linux Firefox profiles and to Gmail/Drive in the Android emulators; API credentials do not establish GUI sessions. Save the browser profiles and emulator snapshots named by the controller configuration. -
Start the Linux services locally on each desktop, then the main-host services (run each command in a persistent terminal):
# Linux desktop 1 bash replan_lab/scripts/start_linux_services.sh --device-id linux_device_1 # Linux desktop 2 bash replan_lab/scripts/start_linux_services.sh --device-id linux_device_2 # Main host, after both Linux controllers are healthy bash replan_lab/scripts/start_main_services.sh
The scripts launch the CLI/GUI MCP servers, controllers, relay, WebSocket servers, Android ADB MCP servers, and device-agent clients on their respective machines. They do not perform remote login or start the benchmark.
-
Point
eval_action_relay.yamlandeval_injection.yamlat the real controller URLs and enable real provider execution. SetOCTONEST_PREFLIGHT_URLSto the relay and all four controller/healthzURLs. Verify the services before evaluating.
The formal evaluation entry point is replan_lab/dataset_builder/eval_pipeline.py; it renders run-local specifications and writes results to experiments/replan_lab/pipeline_runs/<run_id>/.
Once the runtime is configured and healthy, run a single CAPEBench variant through the formal pipeline:
python replan_lab/dataset_builder/eval_pipeline.py \
--run-dir experiments/replan_lab/pipeline_runs/capebench_check \
--variant-id SEED_01_MAIL_TO_ISSUE_MEETING_ACK__BASELINE \
--enable-github-api --enable-google-api --use-mdc-executor \
--agent-api-tool-profile v2_limited \
--allowed-token-model deepseek-v4-pro \
--allowed-token-model kimi-k2.5Omit --variant-id for all 158 variants. Use a fresh run directory for each evaluation and set --allowed-token-model to the exact model names configured for your agents. Running the benchmark changes the connected GitHub/Google accounts and device state; use isolated test accounts and devices.
OctoNest is built on top of Microsoft's UFO framework, including its Galaxy/UFO³ multi-device codebase. We retain upstream module names and copyright notices where applicable. See NOTICE.md for attribution details.
If you use OctoNest or CAPEBench, please cite our paper:
@misc{yao2026octonest,
title = {{OctoNest}: Adaptive Cross-Device Execution through Stateful Control},
author = {Shu Yao and Yuhua Luo and Qian Long and Jingru Fan and Yuheng Wang and Lin Wu and Zhuoyuan Yu and Yufan Dang and Huatao Li and Chen Qian},
year = {2026},
eprint = {2606.20487},
archivePrefix = {arXiv},
primaryClass = {cs.CL},
url = {https://arxiv.org/abs/2606.20487}
}This repository is released under the MIT License. Third-party components remain subject to their original notices and licenses.
