From 009a74a8e3999f7fb521fffa3993326fffa40e0b Mon Sep 17 00:00:00 2001 From: orca-bug-scan-bot Date: Sat, 27 Jun 2026 20:28:45 -0700 Subject: [PATCH] fix: address pr-bug-scan validated finding from #6527 Wrapped pairing-runtime startup in main() in a local try/catch so its failure logs a warning and continues the launch instead of hitting main()'s catch+exit(1). --- mobile/scripts/start-emulator.mjs | 35 +++++++++++++++++++------------ 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/mobile/scripts/start-emulator.mjs b/mobile/scripts/start-emulator.mjs index 15af9382708..6cf94d2aa75 100755 --- a/mobile/scripts/start-emulator.mjs +++ b/mobile/scripts/start-emulator.mjs @@ -545,19 +545,28 @@ async function main() { logInfo(`Using worktree: ${worktree}`) await ensureMobileDependencies(worktree) - pairingRuntime = await startHeadlessPairingRuntime({ - enabled: options.pair, - orcaCli: ORCA_CLI, - cwd: process.cwd(), - lanIpCandidates, - logStep, - logSuccess - }) - await registerWorktreeForPairingRuntime(pairingRuntime, worktree, { - orca, - logStep, - logSuccess - }) + // Why: the temporary pairing runtime is auxiliary to launching the app. If it + // fails to start, never emits a pairing URL, or its worktree registration + // fails, keep going with the app launch instead of aborting the whole flow. + try { + pairingRuntime = await startHeadlessPairingRuntime({ + enabled: options.pair, + orcaCli: ORCA_CLI, + cwd: process.cwd(), + lanIpCandidates, + logStep, + logSuccess + }) + await registerWorktreeForPairingRuntime(pairingRuntime, worktree, { + orca, + logStep, + logSuccess + }) + } catch (error) { + pairingRuntime?.stop() + pairingRuntime = null + logError(`Skipping mobile pairing: ${error.message}`) + } // Find best device const device = await findBestDevice(options.device)