Skip to content

fix(j5): status shows the emulator to open only once it has booted - #839

Merged
Jacksondr5 merged 2 commits into
j5/mainfrom
j5code/mobile-boot-status
Oct 31, 2026
Merged

Jacksondr5 merged 2 commits into
j5/mainfrom
j5code/mobile-boot-status

Conversation

@Jacksondr5

Copy link
Copy Markdown
Owner

Problem

The live-test crew's Android testers called device_open too early and got "No device emulator-55xx on host local". The Device panel lists an emulator only after Android has booted, which takes about 2 minutes. Setup itself waits for that before printing the device, but two paths showed the serial early:

  • status printed the device_open line for an emulator that was still booting;
  • on a cold start, setup's time budget can run out mid-boot, and its message only said "run the same command again".

What changed

In scripts/j5/live-test-mobile.ts:

  • status (formatMobile) checks sys.boot_completed before naming the device. While the emulator boots, it says "emulator-55xx is still booting; do not call device_open yet", followed by the setup command, which waits for it. An emulator that isn't running is reported as such.
  • Setup's timeout message now says not to call device_open yet, and that running the command again waits and then prints the device to open.
  • waitForBoot and status share one small emulatorBooted helper.

Live testing

Builder, at 8ec26f07cb, on openclaw:

  • During boot: status printed "j5-tester-2: emulator-5558 is still booting; do not call device_open yet. … --mobile android waits for it".
  • After boot: a fresh --mobile android printed deviceId "emulator-5556", and status printed the same line, with Emulator: RUNNING. stop left no emulator, AVD or claim behind.
  • Observation, not caused by this PR: in the first run, with two other testers' emulators also booted, mine exited during boot. The log shows no clear reason, so it was probably load (three emulators rendering on the CPU). The rig reported it: "The emulator exited while booting".

Checklist

Built by Claude Opus 5.5 in Claude Code (J5 Code crew seat).

🤖 Generated with Claude Code

The Device panel lists an emulator only after Android has booted, so testers
who took the serial from status, or from a setup that ran out of time, got
"No device emulator-55xx". status now says the emulator is still booting and
names the command that waits for it, and setup's timeout says not to call
device_open yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
j5-code Ready Ready Preview Oct 31, 2026 10:58pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 1 billable file and costs up to $0.25.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 30 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 50 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 66c3105 and eb10868.

Files selected for processing: 1
  • scripts/j5/live-test-mobile.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:S 10-29 effective changed lines (test files excluded in mixed PRs). labels Oct 31, 2026

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combined review from both reviewers (Claude Opus 5.5 and GPT Sol 6.1), at 8ec26f07cb: no blocking findings.

  • emulatorBooted is a straight extraction from waitForBoot; its behaviour is unchanged.
  • The device line in formatMobile now checks the emulator process first, then the boot. Checked with fake SDK commands and a captured process identity, with no real device:
    • booted=0: no deviceId, and a warning not to call device_open;
    • booted=1: prints emulator-5556;
    • process gone: "not running".
  • Not yet visible to adb: empty stdout, which counts as not booted.

Optional nit: while the emulator is booting, the Next: block below still says "1. device_open with the ids above". No ids are printed then, so it does no harm, but a cold agent sees two instructions that disagree. Step 1 could be dropped or changed while booting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combined re-review from both reviewers (Claude Opus 5.5 and GPT Sol 6.1), at eb10868482: the nit is resolved, and there are no findings.

  • Next: follows the emulator's state. Checked with fake SDK commands:
    • booting: no device_open; it says to run setup, which waits;
    • stopped: it says setup starts the emulator;
    • ready, on Android and iOS: it keeps device_open and then mobile-open.
  • Teardown matches #838: agent-device close, then device_close, then stop.

@github-actions github-actions Bot added size:M 30-99 effective changed lines (test files excluded in mixed PRs). and removed size:S 10-29 effective changed lines (test files excluded in mixed PRs). labels Oct 31, 2026
@Jacksondr5
Jacksondr5 merged commit ec95d28 into j5/main Oct 31, 2026
32 checks passed
@Jacksondr5
Jacksondr5 deleted the j5code/mobile-boot-status branch October 31, 2026 23:16

This branch was successfully deployed

1 active deployment
Preview — eb108684 Deployed Oct 31, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 effective changed lines (test files excluded in mixed PRs). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant