Repository navigation
Conversation
1d1ca14 to
1597ffa
Compare
|
Important Review skippedWe couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting You can disable this status message by setting the Use the checkbox below for a quick retry:
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | Docstring coverage is 23.81% which is insufficient. The required threshold is 80.00%. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (4 passed)
-
Check name Status Explanation Title check ✅ Passed The title clearly and concisely summarizes the main change: support for ADB network device connections. Description check ✅ Passed The description clearly covers scope, rationale, testing, UI behavior, security, limitations, and upstream context, with only minor template deviations. Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Comment @coderabbitai help to get the list of available commands.
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
src/main/emulator/backends/android-emulator-backend.ts (1)
172-186: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winExtend the network-serial guard to
resolveDeviceId, not just the boot path.
android-avd-boot.ts'sbootAndroidDevicenow special-casesisAdbNetworkSerial(deviceOrName)to fail with an actionable "not connected, connect it in Settings > Mobile Emulator" message.resolveDeviceIdhere — used bytap,gesture,type,button,exec,installApp,launchApp,setPermission,accessibilityTree,logcat, andshutdownDevice— has no equivalent guard, so any of those calls against a configured-but-disconnected network address instead get the boot-oriented"is not running. Boot it first."message, which is misleading (there is nothing to "boot").♻️ Proposed fix
async resolveDeviceId(deviceOrName: string): Promise<string> { const sdk = this.requireSdk() const running = await listRunningAdbDevices(this.runner, sdk) if (running.some((device) => device.serial === deviceOrName)) { return deviceOrName } const serial = await findRunningAvdSerial(this.runner, sdk, deviceOrName, running) if (serial) { return serial } + if (isAdbNetworkSerial(deviceOrName)) { + throw new EmulatorError( + 'emulator_adb_not_connected', + `ADB device ${deviceOrName} is not connected. Connect it in Settings > Mobile Emulator.` + ) + } throw new EmulatorError( 'emulator_device_not_found', `Android device "${deviceOrName}" is not running. Boot it first.` ) }
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 4fbf01bd-2fb0-4c56-a539-1a11aec0354a
📥 Commits
Reviewing files that changed from the base of the PR and between 334027c and 1d1ca1488a6368543a4166e7287dfc7f7d628058.
📒 Files selected for processing (41)
docs/android-emulation.mdskill-guides/orca-emulator-android.mdskills/orca-emulator-android/SKILL.mdsrc/cli/bundled-skill-guides.tssrc/main/emulator/android/adb-device-connection.test.tssrc/main/emulator/android/adb-device-connection.tssrc/main/emulator/android/adb-network-endpoint.test.tssrc/main/emulator/android/adb-network-endpoint.tssrc/main/emulator/android/android-avd-boot.test.tssrc/main/emulator/android/android-avd-boot.tssrc/main/emulator/android/android-capability-operations.test.tssrc/main/emulator/android/android-device-inventory.test.tssrc/main/emulator/android/android-device-inventory.tssrc/main/emulator/android/android-input-commands.test.tssrc/main/emulator/android/android-screen-size-cache.tssrc/main/emulator/android/android-sdk-discovery.test.tssrc/main/emulator/android/android-sdk-discovery.tssrc/main/emulator/backends/android-emulator-backend.test.tssrc/main/emulator/backends/android-emulator-backend.tssrc/main/emulator/emulator-bridge.test.tssrc/main/emulator/emulator-bridge.tssrc/main/emulator/emulator-errors.tssrc/main/runtime/orca-runtime-emulator-adb.tssrc/main/runtime/orca-runtime-emulator.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/rpc/methods/emulator.test.tssrc/main/runtime/rpc/methods/emulator.tssrc/renderer/src/components/settings/MobileEmulatorAdbConnection.test.tsxsrc/renderer/src/components/settings/MobileEmulatorAdbConnection.tsxsrc/renderer/src/components/settings/MobileEmulatorSettingsPane.tsxsrc/renderer/src/components/settings/mobile-emulator-adb-default-device-hygiene.test.tssrc/renderer/src/components/settings/mobile-emulator-adb-default-device-hygiene.tssrc/renderer/src/components/settings/mobile-emulator-search.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/shared/constants.test.tssrc/shared/constants.tssrc/shared/types.ts
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 73d372e1-664a-4095-9414-a976b2779bff
📥 Commits
Reviewing files that changed from the base of the PR and between 1d1ca1488a6368543a4166e7287dfc7f7d628058 and 1597ffa6c07d3e188db002e9499ffb342f4b21a1.
📒 Files selected for processing (4)
docs/android-emulation.mdskill-guides/orca-emulator-android.mdskills/orca-emulator-android/SKILL.mdsrc/cli/bundled-skill-guides.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- src/cli/bundled-skill-guides.ts
- docs/android-emulation.md
- skill-guides/orca-emulator-android.md
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 969d60ef-8e4b-4fec-a630-717ff16d8ce2
📥 Commits
Reviewing files that changed from the base of the PR and between f87a1e968c1e74461a38ffefa75be406036ef303 and 19b93004e4203dfdbe89f7e3d654fca8be305a44.
📒 Files selected for processing (13)
docs/android-emulation.mdresources/skills/current-manifest.jsonresources/skills/release-mapping.jsonresources/skills/snapshot-registry.jsonskill-guides/orca-emulator-android.mdskills/orca-emulator-android/SKILL.mdsrc/cli/bundled-skill-guides.tssrc/main/emulator/android/android-avd-boot.tssrc/main/emulator/android/android-sdk-state.tssrc/main/emulator/backends/android-emulator-backend.test.tssrc/main/emulator/backends/android-emulator-backend.tssrc/main/emulator/emulator-availability.test.tssrc/main/emulator/emulator-errors.ts
🚧 Files skipped from review as they are similar to previous changes (6)
- src/main/emulator/emulator-errors.ts
- src/cli/bundled-skill-guides.ts
- docs/android-emulation.md
- src/main/emulator/backends/android-emulator-backend.test.ts
- skill-guides/orca-emulator-android.md
- src/main/emulator/backends/android-emulator-backend.ts
| "appVersion": "1.4.150-rc.0", | ||
| "skills": { | ||
| "computer-use": 5, | ||
| "linear-tickets": 7, | ||
| "orca-cli": 35, | ||
| "orca-emulator": 4, | ||
| "orca-emulator-android": 2, | ||
| "orca-linear": 5, |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Map orca-emulator-android to revision 3 for this release.
Line 585 still points 1.4.150-rc.0 to revision 2, while resources/skills/current-manifest.json and resources/skills/snapshot-registry.json declare the newly shipped snapshot as revision 3. The runtime provenance builder will therefore have no released-app entry for revision 3.
Proposed fix
- "orca-emulator-android": 2,
+ "orca-emulator-android": 3,📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "appVersion": "1.4.150-rc.0", | |
| "skills": { | |
| "computer-use": 5, | |
| "linear-tickets": 7, | |
| "orca-cli": 35, | |
| "orca-emulator": 4, | |
| "orca-emulator-android": 2, | |
| "orca-linear": 5, | |
| "appVersion": "1.4.150-rc.0", | |
| "skills": { | |
| "computer-use": 5, | |
| "linear-tickets": 7, | |
| "orca-cli": 35, | |
| "orca-emulator": 4, | |
| "orca-emulator-android": 3, | |
| "orca-linear": 5, |
19b9300 to
a801920
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/main/emulator/android/adb-network-endpoint.ts (1)
1-2: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winReduce multi-line explanatory comments.
Keep only the non-obvious rationale. Use one concise line where possible.
src/main/emulator/android/adb-network-endpoint.ts#L1-L2: compress the parser scope comment.src/main/emulator/android/adb-network-endpoint.ts#L19-L22: compress the IPv4 validation rationale.src/main/emulator/android/adb-network-endpoint.ts#L30-L33: compress the parser contract comment.src/main/emulator/android/adb-network-endpoint.ts#L87-L89: compress the serial-routing comment.src/main/emulator/backends/android-emulator-backend.ts#L90-L91: replace the public-field implementation detail with a concise contract comment.src/main/emulator/backends/android-emulator-backend.ts#L110-L111: compress the platform-tools rationale.src/main/emulator/backends/android-emulator-backend.ts#L149-L150: compress the availability-message rationale.src/main/emulator/backends/android-emulator-backend.ts#L184-L185: compress the offline-device routing rationale.src/main/emulator/backends/android-emulator-backend.ts#L225-L227: compress the shutdown safety rationale.As per coding guidelines, “Comments must be concise, non-obvious, and brief—prefer one line; do not explain obvious behavior or walk through code.”
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b48aed6e-e7a6-4365-ad0c-1612b002bf53
📥 Commits
Reviewing files that changed from the base of the PR and between 9b5538d and a8019204c38c039ae455443b0be6620026bed437.
📒 Files selected for processing (41)
skill-guides/orca-emulator-android.mdsrc/cli/bundled-skill-guides.tssrc/main/emulator/android/adb-device-connection.test.tssrc/main/emulator/android/adb-device-connection.tssrc/main/emulator/android/adb-network-endpoint.test.tssrc/main/emulator/android/adb-network-endpoint.tssrc/main/emulator/android/android-avd-boot.test.tssrc/main/emulator/android/android-avd-boot.tssrc/main/emulator/android/android-capability-operations.test.tssrc/main/emulator/android/android-device-inventory.test.tssrc/main/emulator/android/android-device-inventory.tssrc/main/emulator/android/android-input-commands.test.tssrc/main/emulator/android/android-screen-size-cache.tssrc/main/emulator/android/android-sdk-discovery.test.tssrc/main/emulator/android/android-sdk-discovery.tssrc/main/emulator/android/android-sdk-state.tssrc/main/emulator/backends/android-emulator-backend.test.tssrc/main/emulator/backends/android-emulator-backend.tssrc/main/emulator/emulator-availability.test.tssrc/main/emulator/emulator-bridge.test.tssrc/main/emulator/emulator-bridge.tssrc/main/emulator/emulator-errors.tssrc/main/runtime/orca-runtime-emulator-adb.tssrc/main/runtime/orca-runtime-emulator.tssrc/main/runtime/orca-runtime.tssrc/main/runtime/rpc/methods/emulator.test.tssrc/main/runtime/rpc/methods/emulator.tssrc/renderer/src/components/settings/MobileEmulatorAdbConnection.test.tsxsrc/renderer/src/components/settings/MobileEmulatorAdbConnection.tsxsrc/renderer/src/components/settings/MobileEmulatorSettingsPane.tsxsrc/renderer/src/components/settings/mobile-emulator-adb-default-device-hygiene.test.tssrc/renderer/src/components/settings/mobile-emulator-adb-default-device-hygiene.tssrc/renderer/src/components/settings/mobile-emulator-search.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/shared/constants.test.tssrc/shared/constants.tssrc/shared/global-settings-types.ts
🚧 Files skipped from review as they are similar to previous changes (34)
- src/shared/constants.test.ts
- src/shared/constants.ts
- src/renderer/src/components/settings/mobile-emulator-adb-default-device-hygiene.test.ts
- src/main/emulator/emulator-availability.test.ts
- src/main/emulator/android/android-device-inventory.test.ts
- src/main/emulator/android/android-screen-size-cache.ts
- src/main/runtime/rpc/methods/emulator.ts
- src/cli/bundled-skill-guides.ts
- src/renderer/src/components/settings/mobile-emulator-adb-default-device-hygiene.ts
- src/main/emulator/emulator-errors.ts
- src/main/emulator/android/android-device-inventory.ts
- src/renderer/src/components/settings/MobileEmulatorSettingsPane.tsx
- src/main/emulator/android/android-sdk-state.ts
- src/renderer/src/i18n/locales/en.json
- src/main/emulator/android/android-capability-operations.test.ts
- src/renderer/src/i18n/locales/es.json
- src/main/emulator/android/android-input-commands.test.ts
- src/main/runtime/orca-runtime-emulator.ts
- src/main/runtime/orca-runtime.ts
- src/renderer/src/components/settings/mobile-emulator-search.ts
- src/main/emulator/android/adb-device-connection.test.ts
- src/main/emulator/android/adb-network-endpoint.test.ts
- src/main/emulator/emulator-bridge.ts
- src/main/runtime/rpc/methods/emulator.test.ts
- src/main/emulator/android/android-sdk-discovery.ts
- skill-guides/orca-emulator-android.md
- src/main/runtime/orca-runtime-emulator-adb.ts
- src/main/emulator/android/android-sdk-discovery.test.ts
- src/renderer/src/components/settings/MobileEmulatorAdbConnection.test.tsx
- src/main/emulator/backends/android-emulator-backend.test.ts
- src/renderer/src/i18n/locales/ko.json
- src/main/emulator/emulator-bridge.test.ts
- src/renderer/src/components/settings/MobileEmulatorAdbConnection.tsx
- src/main/emulator/android/adb-device-connection.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.
216b6c6 to
44ea795
Compare
|
| const previousSerial = | ||
| lastStatusRef.current.address === (previous || null) ? lastStatusRef.current.serial : null |
There was a problem hiding this comment.
Default cleanup depends on status
When the user replaces the saved address before the initial status request completes, lastStatusRef still contains null and the old network serial is not cleared as the default device, causing subsequent emulator actions to target the disconnected previous device.
| const previousSerial = | |
| lastStatusRef.current.address === (previous || null) ? lastStatusRef.current.serial : null | |
| const previousSerial = | |
| lastStatusRef.current.address === (previous || null) | |
| ? lastStatusRef.current.serial | |
| : previous || null |
Knowledge Base Used:
44ea795 to
d31d08b
Compare
dcbcd76 to
fcacb55
Compare
fcacb55 to
673e30e
Compare
2c2b50b to
1fd2892
Compare
29eb764 to
17c0c1d
Compare
17c0c1d to
a72fa8c
Compare
a41bc1a to
d32480a
Compare
77c9ca4 to
40e5c2d
Compare
4e9e080 to
748effe
Compare
ca1708a to
2dfcc41
Compare
2b3c7af to
df9c261
Compare
Connect an Android device or cloud phone by host:port from Mobile Emulator settings. adb connect stays explicit, and replacing the saved address clears a default device that pointed at the previous network serial even when connection status has not returned yet. Rebased onto current main. Upstream no longer ships the skill release map, so the android guide update stays in the bundled skill guide. Co-authored-by: s546126 <[email protected]>
Current main moved the RPC error class out of the client module. The ADB connection pane still imported it from the old path, so a missing method crashed the instanceof check instead of showing the unsupported state.
df9c261 to
5ce91e1
Compare
Upstream no longer removes every adb forward on helper stop, because --remove-all ignores -s and would drop other devices. Disconnect still clears the session before adb disconnect.
|
Closing as the PATH |
Summary
Adds first-class support for connecting a locally reachable Android device or cloud phone by ADB TCP address in Settings > Mobile Emulator, feeding the existing inventory → EmulatorBridge → scrcpy pipeline (no second backend, no new video transport):
host:portaddress, Connect/Disconnect, explicit status (disconnected / connecting / connected / unauthorized / offline / failed), reachability help text and an ADB-exposure security warning. Success is verified viaadb devices -lstate=device, never inferred fromadb connecttext or exit code.adb; theemulator/avdmanagerbinaries moved behind an optionalavdToolscapability, so connected-device workflows work without Android Studio while full-SDK AVD flows are unchanged.adb disconnect.adb emu killis guarded to localemulator-\d+serials; TCP/USB serials can never receive it from any teardown path.host:portserial is classified as Android before theownsDevice/platform fallback inEmulatorBridge, so an offline127.0.0.1:5555on macOS routes to Android with actionable "connect it in Settings" guidance instead of falling through to iOS or AVD boot. Connect (RPC) is the only code path that ever runsadb connect.emulator.adbConnect/adbDisconnect/adbConnectionStatus, local runtime only), additiveemulator_adb_*error codes, one persisted settingmobileEmulatorAdbAddress, default-device hygiene that only clears a default pointing at the previous network serial, and docs/skill updates.Also submitted upstream as #9950. The branch is rebased onto upstream
main(334027cfd): 4 commits,121e61297 → 34703f26c → a78b1a865 → 1597ffa6c. This fork'smainpredates the Android/scrcpy backend, so the diff shown here vs the fork'smainincludes upstream history; the upstream PR shows the clean 4-commit diff.Screenshots
No screenshots available from this headless environment — the new section reuses the existing settings primitives (SettingsRow/Label/Input/Button/Badge with existing status tokens). UI behavior is covered by component tests.
Testing
pnpm typecheck(all three tsc projects pass, re-run after the rebase onto upstreammain)pnpm testfor all touched areas:src/main/emulator, emulator RPC methods, settings components/shared defaults — 962 tests pass post-rebase, including new suites for endpoint grammar, connect/disconnect/status polling, emu-kill guards, bridge routing regression (offline127.0.0.1:5555on darwin → Android), lifecycle (tab close/app quit never disconnect), single in-flight op, defaults/hygiene, and stale-response guardingoxlintclean on touched files; the branch's own i18n keys verified present in all five locale catalogs after the rebase conflict resolutionpnpm lintfull:verify:skill-bundle-manifestcannot pass on this fork (upstream release tags absent; also fails on the clean base — see the CI-triage comment below).verify:localization-catalogcurrently fails on upstreammainitself (pre-existing upstream drift in e.g.sleep-worktree-flow.ts), reproduced on a clean upstream checkout — intentionally not papered over in this PRpnpm buildnot run in this environmentNo live smoke test against a real reachable ADB endpoint was run; verification is via mocked-runner tests.
AI Review Report
Implemented via a staged multi-agent workflow: each stage (SDK capability split → endpoint grammar + guards → connection manager → RPC → settings UI → docs) was implemented, then independently reviewed by a stronger reviewer model that re-ran tests/typecheck and specifically hunted for: auto-connect paths outside the Connect RPC,
emu killguard gaps, success inferred withoutadb devices -l, error-code mutations, parser/serial-recognition grammar divergence, over-engineering, and scope creep. All blocking findings were fixed in-loop. Cross-platform was explicitly checked: SDK discovery paths for macOS/Linux/Windows incl.adb.exe/emulator.exe/avdmanager.batviapath.join(unit-tested per platform), no shortcut/label changes, no shell-specific commands.Security Audit
execFile-basedAndroidCommandRunnerwith arg arrays (no shell interpolation); the validated address is passed as a single argv element.Notes
emu killguard: TCP/USB serials never receive it; local AVD shutdown behavior unchanged.currentAddress()insertion-order nuance is unobservable in v1's single-address model; a failed disconnect drops the address→serial mapping before surfacing the residual entry (mapping is address==serial today).ELI5
You can connect a phone or device over ADB network (host:port) in Settings → Mobile Emulator. Connect/disconnect and status feed the same emulator pipeline as USB devices—no separate video stack.