Skip to content

Android capture: stock-UIAutomator fallback removed collaterally in #1217 — decide intended behavior (hard-fail vs disclosed degradation) #1284

Description

@thymikee

Summary — filing this as a product decision, not a regression report

#1217 (refactor: replace Maestro compat with typed direct engine) removed captureStockUiHierarchy, the
stock-UIAutomator fallback for Android snapshot capture. Behavior change:

Before #1217 Merged main
helper artifact missing/unbuilt warn + degrade to stock UIAutomator dump (captures) hard COMMAND_FAILED — no capture

Verified: captureStockUiHierarchy is gone from src/** entirely (not relocated); pre-#1217 daemons log
"Android snapshot helper unavailable; using stock UIAutomator dump" and capture fine, merged main errors.
Repro: pnpm build (without pnpm build:android) → any Android snapshot → Android snapshot helper is unavailable: the bundled helper artifact was not found.

The hard-fail is arguably the RIGHT behavior — that's why this is a decision, not a bug

The stock fallback was not a harmless degradation. It silently produced a materially different
capture
: app-window-only, no systemui/IME, different ordering. That silent difference caused real
confusion repeatedly in the last week's investigations — it was a documented footgun in the E4 work, and it
interacts directly with the chrome filter, divergence screen.refs, and #1264's capture-scope semantics.
Silent degradation to a weaker observation is exactly the failure class this repo has been systematically
eliminating.
So failing loudly is defensible on the merits.

But it still needs a deliberate call

The removal happened collaterally inside a Maestro-engine refactor — there's no sign it was a
deliberated product decision, and the deciding case wasn't considered: runtime helper failure on real
devices
(OEMs that reject the APK install, permission quirks). Packaged users are fine until they
aren't — and when they aren't, they now lose Android capture entirely instead of degrading.

Options

(a) Keep hard-fail, add an actionable hint. Dev builds: "run pnpm build:android". Packaged: version-
mismatch guidance. Loud, honest, no silent weak observations.

(b) Disclosed degradation. Fall back to stock but stamp the responsebackend: "stock-uiautomator" plus a capture-quality marker — so nothing downstream (chrome filter, divergence refs,
capture-scope) can mistake it for a full capture.

(c) Explicit opt-in flag for the stock path.

Recommendation: (a) as the default, plus investigate real-device helper install-failure rates before
deciding whether (b) is warranted as a safety net.

Connection

#1275 / #1281 (Android automation-helper consolidation — one persistent helper owning
snapshot + viewport + injection) make the helper load-bearing platform infrastructure, which weakens the
case for any stock fallback long-term. This decision should be made consistently with that direction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in-progressWork is actively in progress

    Type

    No type

    Fields

    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