fix(kotlin): gate synthesizeStream on ensureServicesReady before the voice lookup - #612
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe TTS ChangesTTS readiness
Estimated code review effort: 1 (Trivial) | ~2 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
That test asserts a 250 ms wall-clock budget for coroutine cancellation to propagate across five consumers on The clearest evidence that neither diff causes it: the exact same test failed in the same way on #611, which changes only TypeScript and contains no Kotlin at all. It also failed once on #608 (a Dart-only change) and then passed on an identical re-run. Re-triggering with an unchanged diff rather than pushing a fix for it. |
…voice lookup synthesizeStream() queried the model lifecycle for a loaded speech synthesis voice without first waiting for phase 2 initialisation. If a caller starts streaming before phase 2 finishes, currentModel reports found = false and the Flow closes without emitting, so a voice that is actually present looks like no voice at all. Every sibling already gates on this: synthesize() calls ensureServicesReady() before the same lifecycle query, transcribeStream() calls it before its own, and Swift's synthesizeStream awaits it before reading loadedModelSnapshot. Add the missing call. Signed-off-by: ayaangazali <ayaangazali.work@gmail.com>
1965930 to
29215c0
Compare
|
thanks for the fix @ayaangazali |
What
RunAnywhere.synthesizeStream(...)checksisInitializedand then goes straight to the model lifecycle to find a loaded speech synthesis voice, without waiting for phase 2 initialisation.If a caller starts streaming before phase 2 finishes,
currentModel(...)reportsfound = falseand the Flow closes without emitting a single output, so a voice that is actually loaded looks to the caller like no voice at all.One line: call
ensureServicesReady()before the lifecycle query.Why
Every sibling on this path already gates on it, so the streaming variant is the odd one out:
synthesize(...)(same file) callsensureServicesReady()immediately before the identicalcurrentModel(MODEL_CATEGORY_SPEECH_SYNTHESIS)query.transcribeStream(...)inRunAnywhereSTT.ktcalls it before its own lifecycle query.synthesizeStreamawaitsensureServicesReady()before readingloadedModelSnapshot(category: .speechSynthesis).The call is left unwrapped to match
transcribeStreamin this SDK. I deliberately did not copy Swift'sdo/catchthat finishes the stream silently on a phase 2 failure, since swallowing that error would leave the caller with an empty stream and no way to tell why.Testing
From
sdk/runanywhere-kotlin(JDK 17):./gradlew :compileDebugKotlin :ktlintMainSourceSetCheck -Prunanywhere.useLocalNatives=false— BUILD SUCCESSFUL.Scoped to the root module because
:modules:runanywhere-core-onnx:downloadJniLibscannot fetch native libs on this machine. No test added: this is a one-line ordering fix on a path whose behaviour is validated end to end through the example apps.🤖 Generated with Claude Code
Summary by CodeRabbit