Skip to content

automate_observation: report manual-intervention prompts in --events - #35

Merged
billy-lau merged 1 commit into
android:mainfrom
billy-lau:uraniborg/improvements
Sep 29, 2026
Merged

billy-lau merged 1 commit into
android:mainfrom
billy-lau:uraniborg/improvements

Conversation

@billy-lau

Copy link
Copy Markdown
Member

Two steps wait for a person: the manual Hubble install on Xiaomi phones (Enter on stdin) and the adb backup confirmation (on the device). A parent process could see neither. Report each as a new prompt event {device, kind, message, expects_input}, always followed by prompt_resolved with an outcome (done, failed, stdin_closed, interrupted, ...). Kinds: xiaomi_manual_install (write a newline to stdin to continue) and adb_backup_confirm (nothing to send).

If stdin closes during the Xiaomi wait, the device now fails with reason stdin_closed and the run continues, logging a plain error instead of an "Unexpected error" traceback (exit code still 1). New event types only, so v stays 1. Without --events, log text and exit codes are unchanged except for the stdin-closed case, and the Xiaomi wait's log lines now show wait_for_xiaomi_manual_install() as their function name.

Test:

  • pytest uraniborg/scripts/python/tests/: 129 passed (13 new; one existing test gained events=None in its expected calls).
  • Live on an Android 14 emulator with the Xiaomi path forced: stdin closed (outcome stdin_closed, device fails), and a driver that answers the prompt by installing Hubble and writing a newline (outcome done, success).

Change-Id: I57712611e0c27fec5ed284da7d9a78838abe3b41

Two steps wait for a person: the manual Hubble install on Xiaomi
phones (Enter on stdin) and the `adb backup` confirmation (on the
device). A parent process could see neither. Report each as a new
`prompt` event {device, kind, message, expects_input}, always followed
by `prompt_resolved` with an `outcome` (done, failed, stdin_closed,
interrupted, ...). Kinds: xiaomi_manual_install (write a newline to
stdin to continue) and adb_backup_confirm (nothing to send).

If stdin closes during the Xiaomi wait, the device now fails with
reason stdin_closed and the run continues, logging a plain error
instead of an "Unexpected error" traceback (exit code still 1).
New event types only, so v stays 1. Without --events, log text and
exit codes are unchanged except for the stdin-closed case, and the
Xiaomi wait's log lines now show wait_for_xiaomi_manual_install() as
their function name.

Test:
- pytest uraniborg/scripts/python/tests/: 129 passed (13 new; one
  existing test gained events=None in its expected calls).
- Live on an Android 14 emulator with the Xiaomi path forced: stdin
  closed (outcome stdin_closed, device fails), and a driver that
  answers the prompt by installing Hubble and writing a newline
  (outcome done, success).

Change-Id: I57712611e0c27fec5ed284da7d9a78838abe3b41
@billy-lau
billy-lau merged commit c67a5e8 into android:main Sep 29, 2026
7 checks passed
@billy-lau
billy-lau deleted the uraniborg/improvements branch September 29, 2026 15:52
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