Skip to content

fix: keep native voice recording through long turns - #715

Merged
rogerchappel merged 1 commit into
mainfrom
agent/fix-longform-native-voice
Jul 20, 2026
Merged

rogerchappel merged 1 commit into
mainfrom
agent/fix-longform-native-voice

Conversation

@rogerchappel

Copy link
Copy Markdown
Owner

What changed

  • remove the native iOS Agent voice session's unconditional 20-second turn finalization
  • wait for three seconds of sustained silence before finalizing, reducing cutoffs during natural pauses
  • emit a one-time native.recording.long-form diagnostic after 20 seconds while capture continues
  • add regression coverage to keep the hard duration cutoff from returning

Root cause

The native VAD completed a recording when either silence reached 1.8 seconds or total recording duration reached 20 seconds. A continuously speaking user was therefore forcibly sent to transcription at roughly 20 seconds, after which the partial transcript was immediately submitted to chat.

User impact

Regular, non-realtime Agent voice can now capture speech beyond 20 seconds and tolerates longer natural pauses before starting the assistant response.

Verification

  • pnpm test -- src/lib/native-voice-session-generator.test.ts
  • pnpm typecheck
  • pnpm exec eslint apps/mobile/scripts/ensure-ios-voice-session.mjs src/lib/native-voice-session-generator.test.ts
  • xcodebuild -project App.xcodeproj -scheme App -sdk iphonesimulator -configuration Debug CODE_SIGNING_ALLOWED=NO build
  • pre-push pnpm build
  • git diff --check

Remaining risk

Very long turns are still uploaded as one WAV/STT request. Rolling transcription segments should be implemented separately rather than expanding this focused fix.

@rogerchappel
rogerchappel marked this pull request as ready for review July 20, 2026 21:33
@rogerchappel
rogerchappel merged commit c22d51d into main Jul 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant