{"record":{"id":"d4b714a27290edd7","repo":"stablyai/orca","slug":"emulator-no-active","errorCode":"emulator_no_active","errorMessage":"No active emulator stream for gesture input","messagePattern":"No active emulator stream for gesture input","errorType":"exception","errorClass":"EmulatorError","httpStatus":null,"severity":"error","filePath":"src/main/emulator/backends/ios-emulator-backend.ts","lineNumber":153,"sourceCode":"    }\n    return { available: true, devices, message: 'Ready' }\n  }\n\n  async tap(deviceId: string, x: number, y: number): Promise<void> {\n    const udid = await this.resolveDeviceId(deviceId)\n    await this.execServeSim(['tap', x.toString(), y.toString(), '-d', udid])\n  }\n\n  async gesture(\n    _deviceId: string,\n    points: EmulatorGesturePoint[],\n    wsUrl: string | null\n  ): Promise<void> {\n    if (points.length === 0) {\n      return\n    }\n    if (!wsUrl) {\n      throw new EmulatorError('emulator_no_active', 'No active emulator stream for gesture input')\n    }\n    await sendEmulatorGestureSequence(wsUrl, points)\n  }\n\n  async type(deviceId: string, text: string): Promise<void> {\n    const udid = await this.resolveDeviceId(deviceId)\n    await this.execServeSim(['type', text, '-d', udid])\n  }\n\n  async button(deviceId: string, name: string): Promise<void> {\n    const udid = await this.resolveDeviceId(deviceId)\n    await this.execServeSim(['button', name, '-d', udid])\n  }\n\n  async rotate(deviceId: string, orientation: string): Promise<void> {\n    const udid = await this.resolveDeviceId(deviceId)\n    await this.execServeSim(['rotate', orientation, '-d', udid])\n  }","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/emulator/backends/ios-emulator-backend.ts#L135-L171","documentation":"Thrown by IosEmulatorBackend.gesture when wsUrl is null/empty. The iOS gesture path requires an active WebSocket stream (wsUrl) from the registry, supplied by an attached simulator session; without it there is no channel to deliver the gesture sequence. The backend cannot synthesize a stream, so it throws rather than no-op.","triggerScenarios":"gesture(deviceId, points, wsUrl) called with wsUrl null or empty AND points.length > 0 (the empty-points case returns early). wsUrl comes from an attached serve-sim detached session; if no session is attached, the caller has no wsUrl to pass.","commonSituations":"Calling gesture before startSession has established the detached serve-sim helper (which provides the wsUrl); the simulator session was closed/detached and the registry cleared the wsUrl; attempting gestures on a simulator that was never attached; a routing bug passing null where the registry URL should be.","solutions":["Call startSession(deviceId) first and thread its returned wsUrl into subsequent gesture calls.","If the session was detached, re-attach (start a new session) before issuing gestures.","Guard the call: skip gestures when wsUrl is falsy rather than passing null through.","Verify the iOS backend's session registry is populated for the target simulator."],"exampleFix":"// before: gesture with no active stream\nawait iosBackend.gesture(udid, points, null)\n// after: attach a session, use its wsUrl\nconst session = await iosBackend.startSession(udid)\nawait iosBackend.gesture(udid, points, session.wsUrl)","handlingStrategy":"validation","validationCode":"// Guard gesture calls against a missing stream URL.\nfunction hasStream(wsUrl: string | null): wsUrl is string {\n  return !!wsUrl && wsUrl !== ''\n}","typeGuard":"import { EmulatorError } from '../emulator-errors'\nfunction isNoActiveStream(e: unknown): e is EmulatorError {\n  return e instanceof EmulatorError && e.code === 'emulator_no_active'\n}","tryCatchPattern":"if (!hasStream(wsUrl)) {\n  const session = await iosBackend.startSession(deviceId)\n  wsUrl = session.wsUrl\n}\nawait iosBackend.gesture(deviceId, points, wsUrl)","preventionTips":["Establish a startSession before issuing gestures and thread its wsUrl.","Re-attach when the simulator session is detached.","Skip gesture dispatch when no wsUrl is present rather than passing null."],"tags":["ios","simulator","gesture","no-active-session","emulator"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}