Skip to content

refactor!: commands use core devices directly; actions carry timestamps - #558

Merged
Cyro292 merged 2 commits into
feat/mobilerun-base-reworkfrom
feat/device-to-core
Nov 30, 2026
Merged

Cyro292 merged 2 commits into
feat/mobilerun-base-reworkfrom
feat/device-to-core

Conversation

@Cyro292

@Cyro292 Cyro292 commented Nov 30, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on the base rework (#553); base branch feat/mobilerun-base-rework is a copy of #553's head. Moved from Cyro292#1.

What changes

The framework drops its own device stack and uses mobilerun-core's AsyncDevice everywhere.

  • CLI: options.py / DeviceTarget are gone. device_command, cloud_command and run_command inject a connected core device.
  • Cloud clients: bound CloudResource adapters, PaymentFlow, billing policy.
  • Core: ScreenView / ModelGeometry; recording lives in core/runs and is driven by core action hooks. Core Action, Observation, DeviceDescriptor and AppIdentity replace the framework copies.
  • Macros: rows are stamped schema_version: 2 and keep the action's started_at. Display only: replay ignores it. Older macros still load.
  • Structure: sandbox, extensions, credentials and config are split into one role per folder.
  • Demo: tests/demos/easy_macro_demo.py records a short macro, resets the phone and replays it.
{"schema_version":2,"i":1,"action":"start_app","args":{"app_id":"com.android.settings","activity":null},"started_at":"2026-11-30T16:33:52.002939Z"}

Verification

  • pytest tests/unit: 3,117 passed, 75 skipped.
  • ruff, black and mypy mobilerun clean on the files touched last; mypy mobilerun clean overall.
  • easy_macro_demo.py run live on a local emulator and one cloud phone.

Open points

  • Needs mobilerun-core 2.0.0 (droidrun/mobilerun-core#83), not published yet. uv.lock must be regenerated once it is, so CI here will not be green before that.
  • skills/ submodule edits are not part of this PR; they need their own commit in droidrun/skills.

…ps (DRO-4147)

The framework drops its own device stack and uses mobilerun-core's
AsyncDevice everywhere.

- CLI: options.py/DeviceTarget replaced by device_command, cloud_command
  and run_command, which inject a connected core device.
- clients/cloud: bound CloudResource adapters, PaymentFlow, billing policy.
- core: ScreenView/ModelGeometry, recording moved to core/runs and driven
  by core action hooks; core Action, Observation, DeviceDescriptor and
  AppIdentity replace the framework copies.
- macro: rows are stamped schema_version 2 and now keep the action's
  started_at (display only; replay ignores it). Older macros still load.
- sandbox, extensions, credentials, config: split into one role per
  folder.
- demos: easy_macro_demo.py records, resets and replays a short macro.

Requires mobilerun-core 2.0.0 (droidrun/mobilerun-core#83).
@Cyro292

Cyro292 commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator Author

Why CI is red: unpublished packages, not the code

Every failing job stops at package installation, before any test or type check runs:

Because there is no version of mobilerun-core[local]==2.0.0 and your project depends on
mobilerun-core[local]==2.0.0, we can conclude that your project's requirements are unsatisfiable.

This PR needs two releases that don't exist yet:

  1. mobilerun-core 2.0.0: comes from droidrun/mobilerun-core#83, still in review. PyPI's latest is 1.9.0.
  2. A mobilerun-functions release that allows core 2: the sandbox extra pins mobilerun-functions[device]==0.1.0, which requires mobilerun-core<2. Its code already works with core 2 (Mobilerun(bearer=, base_url=) and connect(..., cloud=True) are unchanged); only the version pin needs updating. Follow-up in droidrun/mobilerun-functions.

pytest (3.11/3.12/3.13), the Type check step of lint, and check-image (amd64/arm64) all fail on that same install error. The black step of lint passes.

Verified locally with a clean install

I installed the PR into a fresh virtualenv using the CI commands, with a locally built mobilerun-core 2.0.0 wheel standing in for the PyPI release and the mobilerun-functions pin relaxed:

Check Result
uv lock / uv sync --locked --extra sandbox --extra dev ✅ resolves
black --check . ✅ 483 files unchanged
ruff check . ✅
mypy mobilerun ✅ no issues in 326 files
pytest tests/unit ✅ 3,117 passed, 75 skipped (one skills-packaging test needs skills/.git, so it only fails in a copy without git; it passes in the real checkout)

To get CI green

  1. Merge and release mobilerun-core 2.0.0 (Where's the .apk? #83).
  2. Release mobilerun-functions with mobilerun-core==2.0.0 and bump its pin here.
  3. Regenerate uv.lock on this branch and push.

No code changes are expected for CI after that.

@Cyro292
Cyro292 marked this pull request as ready for review November 30, 2026 18:29
@Cyro292
Cyro292 merged commit 58e0ad3 into feat/mobilerun-base-rework Nov 30, 2026
5 of 12 checks passed
@Cyro292 Cyro292 changed the title refactor!: commands use core devices directly; actions carry timestamps (DRO-4147) refactor!: commands use core devices directly; actions carry timestamps Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant