Skip to content

Improve voice dictation reliability#3922

Merged
AmethystLiang merged 5 commits into
mainfrom
improve-voice-dictation
Jul 10, 2026
Merged

Improve voice dictation reliability#3922
AmethystLiang merged 5 commits into
mainfrom
improve-voice-dictation

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented May 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Speech stop handling now settles on stopped, error, exit, or timeout instead of waiting indefinitely on worker termination, and tracks the in-flight stop so concurrent stop/teardown calls coordinate on the same worker rather than racing.
  • Reject stale warm-worker reuse when the selected model is no longer ready, and harden the reuse fast-path against a stop that starts concurrently on the same warm worker.
  • Resolve speech worker model files with path.join instead of hardcoded / separators (cross-platform).
  • Keep the stopping flag exception-safe so a failed postMessage can't permanently drop dictation audio.

Checks

  • pnpm typecheck — passing
  • pnpm exec vitest run src/main/speech/stt-service.test.ts — 22 passing
  • pnpm lint runs in CI (local oxlint binary predates .oxlintrc.json's rule set, so the pre-commit lint hook can't run locally)

Electron validation skipped by request.

Risk: medium — touches speech worker lifecycle in the main process.

@nwparker nwparker added the risk:medium Medium risk change label May 30, 2026
AmethystLiang and others added 3 commits July 10, 2026 00:33
# Conflicts:
#	src/main/speech/stt-service.ts
#	src/main/speech/stt-worker.ts
#	src/renderer/src/components/dictation/DictationController.tsx
…, remove dead dictation-hold-release module)

Co-authored-by: Orca <help@stably.ai>
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c63fc6bb-c3b2-46e3-ab02-b38058c6a4a6

📥 Commits

Reviewing files that changed from the base of the PR and between 2cbec04 and 24ef286.

📒 Files selected for processing (1)
  • src/main/speech/stt-service.test.ts
💤 Files with no reviewable changes (1)
  • src/main/speech/stt-service.test.ts

📝 Walkthrough

Walkthrough

SttService now coordinates native worker stop operations through shared in-flight promises, timeout handling, worker identity checks, and outcome-specific teardown. Worker reuse is prevented during active stopping and when model readiness changes. Cloud stopping state cleanup is scoped with finally. Tests cover worker exit, errors, concurrent stops, duplicate stopped events, timeout behavior, and invalid warm-worker reuse. Model, token, and vocabulary paths now use path.join.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary and testing, but it omits required Screenshots, AI Review Report, Security Audit, and Notes sections. Add the missing template sections, including Screenshots, AI Review Report, Security Audit, and Notes, with the requested cross-platform validation details.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately reflects the main change: improving voice dictation reliability.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a3537949-69b5-453d-a1d4-7843889fe344

📥 Commits

Reviewing files that changed from the base of the PR and between f238952 and 2cbec04.

📒 Files selected for processing (3)
  • src/main/speech/stt-service.test.ts
  • src/main/speech/stt-service.ts
  • src/main/speech/stt-worker-model-config.ts

Comment thread src/main/speech/stt-service.test.ts Outdated
@AmethystLiang AmethystLiang merged commit f5ba516 into main Jul 10, 2026
2 checks passed
@AmethystLiang AmethystLiang deleted the improve-voice-dictation branch July 10, 2026 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:medium Medium risk change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants