Repository navigation
Description
Summary
In a folder workspace (folder:<id> context), the Mobile Emulator pane can never connect to a booted Android AVD: it shows the raw internal error string selector_not_found under the device combo and stays "Not connected", while the same device is booted, adb-visible, and even orca emulator attach reports success. CLI scoping is inconsistent in the same shell: attach succeeds, but unqualified list says nothing is running and --worktree active fails with selector_not_found.
Environment
- Orca 1.4.179 (production, macOS),
com.stablyai.orca - macOS Darwin 25.5.0 (arm64)
- Android Emulator 36.4.10.0, AVD
Medium_Phone(android-35, google_apis_playstore, arm64-v8a), serialemulator-5554 - Workspace: a folder context (
ORCA_WORKTREE_ID=folder:46363936-...), i.e. a plain folder workspace, not a git-repo worktree. Shell cwd is a subfolder that is not under any Orca-managed git worktree.
Steps to reproduce
- Open a folder workspace (add a plain folder as a project;
ORCA_WORKTREE_IDis afolder:id). - Boot an Android AVD so it is adb-visible (
adb devicesshowsemulator-5554 device). Either GUI or headless — the result is identical. - Open the Mobile Emulator pane (⌘⌥⇧E / "새로운 모바일 에뮬레이터").
- The pane pre-selects the AVD (
Medium_Phone) but shows "Not connected" with the literal textselector_not_foundand "연결된 에뮬레이터가 없습니다". - Click 연결 (Connect) — the click is accepted but nothing changes; the same
selector_not_foundremains.
CLI evidence (same shell, same cwd)
$ orca emulator devices --json # device is visible and booted
emulator-5554 Medium_Phone booted true
$ orca emulator attach Medium_Phone --focus --json
{"ok":true,"result":{"attached":true,"info":{"deviceUdid":"emulator-5554","streamUrl":"scrcpy://emulator-5554","wsUrl":"","streamCodec":"h264","backend":"android"}}}
$ orca emulator list --json # immediately after the successful attach
{"ok":true,"result":{"running":false}}
$ orca emulator list --worktree active --json
{"ok":false,"error":{"code":"selector_not_found","message":"No Orca-managed worktree contains the current directory: /Users/.../beautyrella/beautyrella_flutter"}}
$ orca emulator attach Medium_Phone --worktree "name:<folder workspace name>" --focus --json
{"ok":false,"error":{"code":"selector_not_found","message":"selector_not_found"}}So attach (unqualified) resolves some scope — presumably via the ORCA_WORKTREE_ID env — and reports success, but list in the same shell and the pane itself resolve a different scope and fail. The three surfaces (attach, list, pane) disagree about what the active emulator scope is.
Expected
- The pane connects to the booted AVD in a folder workspace, or
- if folder workspaces are intentionally unsupported for the emulator surface, the pane says so in a human-readable way instead of leaking the internal error code
selector_not_found, and ideally doesn't offer the device picker at all; attach,list, and the pane agree on scope: anattachthat reports"attached": trueshould be visible tolistand the pane.
Notes
- Possibly the same root cause family as [Bug]: Mobile Source Control retries selector_not_found for folder-workspace git RPCs that were never routed #11153 (folder-workspace git RPCs failing with
selector_not_found— selector routing not handlingfolder:contexts). - The
orca-emulator-androidskill says the Android visual pane (scrcpy/H.264) is still in development. If the pane is currently iOS-only, that's fine — but it currently lists Android AVDs in its combo box and then fails with an internal error string, which reads as a bug rather than an unsupported feature.
Activity
manuaudio commentedon Aug 11, 2026
Your CLI evidence is the whole diagnosis — thank you for capturing all four commands from the same shell. The chain is fully traceable in source, and it ends somewhere better than "scope disagreement":
attachreports success while skipping the half that makes it visible. Checked againstupstream/mainata0a654c3a9.First, a correction: the three surfaces do not resolve different scopes
You inferred that
attachresolves one scope andlistanother. They can't —emulator list,emulator devicesandemulator attachall call the samegetEmulatorCommandTarget(flags, cwd, client)(src/cli/handlers/emulator.ts:118,:123,:128), which calls the samegetEmulatorWorktreeSelector. Same inputs, same result.And two of those RPCs ignore the worktree entirely.
orca-runtime-emulator.ts:172-175:Note the
_params— the selector is accepted and discarded.emulatorListDevices(:201-203) does the same, andemulatorListSimulators(:186-193) says so explicitly: "Worktree param ignored (simulators are host-local, not per-worktree)."So
{"running": false}is not a scoping answer. It means the bridge has no running helper registered. That's the thread to pull.The actual chain
1. A folder workspace has no enclosing managed worktree.
resolveCurrentWorktreeSelector(src/cli/selectors.ts:46-75) walksworktree.listlooking for a record whose path contains your cwd, and throws when none matches:That is verbatim the message your
--worktree activerun printed.2. Unqualified commands swallow that failure.
getEmulatorWorktreeSelector(:221-245):--worktree activetakes the branch at:231-234with no try/catch, which is the only reason it errors loudly. Everything else silently degrades to "no worktree" — so all three of your unqualified commands sentworktree: undefined, identically.3. And that is what breaks attach.
emulatorAttach(orca-runtime-emulator.ts:124-170) resolvesworktreeIdat:144—resolveWorktreeId(:205-207) returnsundefinedfor a falsy selector rather than throwing — and then:With
worktreeIdundefined, the helper does start — soattached: trueis truthful about the device — butregisterActiveEmulatornever runs, and neither renderer notification is sent. Nothing is registered, solistreportsrunning: false, and the pane is never told anything, so it stays "Not connected". Your--focusflag was silently inert for the same reason.So the three surfaces agree about scope perfectly. What they disagree about is whether the attach was recorded, and the
if (worktreeId)guard is why.Two different failures wearing one error code
Worth separating, because they need different fixes:
selector_not_found— "your cwd is not inside a managed worktree." Real, well-described, and swallowed everywhere except--worktree active.selector_not_found— no message, which is a different call site: the pane passes afolder:id and main fails to resolve it. I have not traced that one, so I'm not asserting its mechanism. Your suspected link to [Bug]: Mobile Source Control retries selector_not_found for folder-workspace git RPCs that were never routed #11153 (folder-workspace RPCs failing withselector_not_found) is about the right shape for it, and if that's the same defect this issue is partly a duplicate of the routing problem rather than an emulator problem.On your "unsupported feature vs bug" question
I'd say bug, and specifically the
if (worktreeId)guard. Even if the Android visual pane is still in development,attachreturning{"attached": true}after skipping registration and notification is a success receipt for work that was only half done — a caller cannot distinguish it from a real attach. The narrow fix is for attach to refuse (or report a distinct partial state) when it cannot resolve a worktree to register against, rather than reporting plain success.Also worth noting your
attachreceipt already hints at the incompleteness:"wsUrl": ""alongside"streamUrl": "scrcpy://emulator-5554".What would confirm it
The prediction that follows from the above: run the same attach with an explicit, resolvable worktree selector — one of the ids from
orca worktree list --jsonrather thanactive/name:.worktreeIdbeing undefined, and folder workspaces need a selector the resolver accepts.selector_not_found→ the registration path is fine and the pane's ownfolder:resolution is the remaining defect, which points at [Bug]: Mobile Source Control retries selector_not_found for folder-workspace git RPCs that were never routed #11153.Either way that single run splits the two error codes apart.
What I did not verify
No Android SDK or emulator here, so I have not reproduced the pane state or watched the notifications fire. The CLI resolver, the swallow, the ignored
_params, and theif (worktreeId)guard are read from source and are solid; the pane's ownselector_not_foundis the part I deliberately left untraced.AmethystLiang commentedon Aug 11, 2026
thanks for reporting. looking into it
kimnamwook1 commentedon Aug 11, 2026
Ran the confirmation test from @manuaudio's analysis (same host as the original report, Orca 1.4.179, same booted AVD
Medium_Phone/emulator-5554). Outcome A confirmed — and one new finding aboutlistbelow.1. Attach with an explicit, resolvable worktree selector
2. Registration actually happened this time
Probed the registry via a target-resolving command with
--worktreebut no--device—resolveTargetonly succeeds here ifgetActiveForWorktree(worktreeId)returns a session, otherwise it throwsemulator_no_active:So with a resolvable worktreeId,
registerActiveEmulatorruns and the session is queryable. The registration chain itself is fine.3. The pane connects in a git-worktree workspace
Opened the Mobile Emulator pane (⌘⌥⇧E) in a regular git-worktree workspace on the same host: the pane went "에뮬레이터 연결 중…" → Connected, with a live scrcpy stream of the same booted AVD. So the pane surface works end-to-end when its workspace resolves to a managed worktree — the failure is specific to folder workspaces, exactly as predicted:
folder:id → selector unresolvable →worktreeIdundefined → registration + renderer notifications skipped.4. New finding:
emulator listis iOS-only, so it was a red herringEven with the attach registered and queryable (step 2),
liststill reports nothing:Reason, at
a0a654c3a9—src/main/emulator/emulator-bridge.ts:64-66:emulatorListdelegates straight to the iOS backend, so a fully successful, registered Android attach never appears inorca emulator list. The"running": falsein my original evidence was therefore not additional proof of the registration failure — it's a separate defect (Android-blindlist), stacked on top of theif (worktreeId)guard issue.Summary
folder:selector → undefinedworktreeId→ silent half-attach (attached: truewith no registration/notification).orca emulator list: separate bug — never reports Android helpers, registered or not.selector_not_foundin folder workspaces remains pointing at thefolder:resolution path ([Bug]: Mobile Source Control retries selector_not_found for folder-workspace git RPCs that were never routed #11153 family).manuaudio commentedon Aug 11, 2026
That's a decisive test, and your step 2 is better evidence than what I proposed — probing with
--worktreebut no--devicesoresolveTargetcan only succeed viagetActiveForWorktreeis a much sharper registration probe than anything I suggested. Outcome A confirmed, so theif (worktreeId)guard is the whole of the pane failure.Your
listfinding is right, and it's stronger than you put itI verified
emulator-bridge.ts:64-66at6acd69c516— exactly as you quote:And it isn't only that the bridge delegates to iOS.
listRunningHelpersis implemented in exactly one place in the whole emulator tree —backends/ios-emulator-backend.ts:98. The Android backend doesn't define it at all, so there is nothing to delegate to even if the bridge wanted to.orca emulator listcannot report an Android helper under any circumstances.That correction lands on me too. My comment said
{"running": false}"means the bridge has no running helper registered" — I was right that it wasn't a scoping answer, but wrong about what it was. It isn't a registration report at all; it's a report from a backend that never sees Android. You've replaced my inference with the actual reason.Where that leaves the issue
Three independent defects, now cleanly separated by your run:
folder:selector unresolvable →worktreeIdundefined → silent half-attach (attached: true, no registration, no notification). Confirmed by Outcome A. This is the pane bug.emulator listis Android-blind — independent of folder workspaces entirely, and reproducible on any workspace type with any Android device. Nothing about it involves worktree scoping.selector_not_found— still thefolder:resolution path, still [Bug]: Mobile Source Control retries selector_not_found for folder-workspace git RPCs that were never routed #11153 family, still untraced by me.(2) genuinely doesn't belong in this issue: it has a different trigger, a different file, and a different audience — anyone using
orca emulator listwith Android hits it whether or not they've ever opened a folder workspace. It'd get lost as a sub-finding here. Worth its own report, and your two console blocks plus the:64-66citation are already a complete one.One thing that would sharpen (1) for whoever fixes it
Your successful attach used
--worktree "id:<uuid>::<path>". The failing case is afolder:<id>workspace, whereresolveCurrentWorktreeSelector(cli/selectors.ts:46-75) finds no enclosing managed worktree and throws. So the fix has two candidate shapes, and they're not equivalent:folder:contexts (fixes the whole [Bug]: Mobile Source Control retries selector_not_found for folder-workspace git RPCs that were never routed #11153 family at once), oremulatorAttachrefuse rather than half-succeed whenresolveWorktreeIdreturns undefined (orca-runtime-emulator.ts:144, guard at:161-167).The second is narrow and stops the silent failure everywhere it occurs, including cases nobody has reported yet. The first is the real fix but is a much bigger surface. Ideally both — but if only one lands, the guard is the one that prevents a future
attached: truefrom lying.What I did not verify
I still have no Android SDK here, so steps 1–3 of your run are your measurements. The
emulator-bridge.tsandios-emulator-backend.tsfacts above I checked directly at6acd69c516.