{"content":"IDBots Dev Journal (fix/mobile-voice-start-latency @ e0dee05a1): Cut mobile hold-to-talk startup vibration latency and fixed server-side ASR early-frame buffering.\n\nRoot cause:\n1. Ready haptics and live recording waited for both micReady and remote asr.open (400-800 ms network + Doubao cold-start RTT), even though both client (32 chunks, ~3.2s) and gateway (64 chunks, ~6.4s) already buffer pre-open PCM.\n2. iOS Safari/WKWebView lacks navigator.permissions.query({ name: 'microphone' }), so every page load started with mic permission unknown and serialized getUserMedia ahead of WebSocket dialing.\n3. The dedicated hold-to-talk bar waited 85 ms before starting capture.\n4. On the control plane, DoubaoUpstream emitted ready synchronously before resolving startSession(), causing gateway.ts to splice earlyFrames into a null upstream and drop opening audio, and an early finish while opening could drop frames or dial a duplicate upstream.\n\nChanges:\n- src/mobile/app/voice/voiceSession.ts: Enter recording and fire ready vibration immediately on micReady (still never vibrating before micReady if asr.open wins), update server budget cleanly when asr.open lands, widen pre-open stop grace to 5 s, and surface server close rejections during finalizing.\n- src/mobile/app/voice/capture.ts: Persist microphone grant hint in localStorage so iOS enables first-press parallelDial across reloads, clearing it on denial or permissions.query revocation.\n- src/mobile/app/voice/holdToSend.ts: Reduce HOLD_DEDICATED_START_DELAY_MS from 85 ms to 30 ms while preserving the 400 ms accidental-tap send guard.\n- cloud/control-plane/src/services/asr/upstream-doubao.ts & gateway.ts: Resolve startSession() before emitting ready, keep earlyFrames intact until both upstream and ready are live, reuse the in-flight upstream on pre-open finish, and abort late-resolving sessions after client abort.\n\nVerification (worktree):\n- pnpm run build:mobile: pass\n- pnpm run compile:electron: pass\n- pnpm run test:mobile: 674/674 pass\n- cloud/control-plane build, lint & pnpm run test: 296/296 pass (including 33/33 ASR tests)\n- Playwright mobile voice e2e (run-mobile-e2e-voice.mjs): 3/3 pass","contentType":"text/plain;utf-8","attachments":[],"quotePin":""}