Skip to content

refactor(stt): drop the unreachable /vad endpoint and stt:vad IPC - #919

Merged
EtienneLescot merged 1 commit into
mainfrom
claude/drop-vad-ipc
Sep 30, 2026
Merged

EtienneLescot merged 1 commit into
mainfrom
claude/drop-vad-ipc

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Removes the speech-detection path added with the Silero VAD pre-pass (#639) that nothing could reach: the preload never exposed stt:vad, so the renderer had no way to call detectSpeech, and the helper's /vad endpoint only served that path.

Removed: POST /vad (helper), detectVadSegments / mergeVadIntervals / MAX_VAD_CHUNK_SAMPLES and the vadAvailable tracking (whisperServer.ts), detectSpeech / isVadAvailable and the stt:vad handler (index.ts), STT_VAD_UNAVAILABLE / SttVadResponse (contract), and their tests.

Kept: the VAD model download, --vad-model, and SttVadSegment. /inference uses the model, and #917 uses the type for its speech intervals.

Related issue

Refs #626

Type of change

  • Refactor / maintenance

Release impact

  • No release note needed

Desktop impact

  • Not platform-specific

Testing

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Changes
    • Speech-interval detection is no longer available through the app’s speech-to-text service. The related HTTP endpoint and IPC request have been removed.
    • Speech-to-text transcription and cancellation remain available.

Nothing could reach them: the preload never exposed `stt:vad`, so the
renderer had no way to call `detectSpeech`, and the helper's `/vad`
endpoint only served that path. The VAD model and `--vad-model` stay:
`/inference` uses them.
@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 0a977913-6218-4b33-a9e3-cef705c86dd0

📥 Commits

Reviewing files that changed from the base of the PR and between bc6fa48 and c947095.

📒 Files selected for processing (5)
  • electron/native/whisper-stt/src/main.cpp
  • electron/stt/index.ts
  • electron/stt/transcriptionContract.ts
  • electron/stt/whisperServer.test.ts
  • electron/stt/whisperServer.ts
💤 Files with no reviewable changes (2)
  • electron/native/whisper-stt/src/main.cpp
  • electron/stt/transcriptionContract.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

The change removes VAD detection from the native Whisper HTTP server and Electron STT interfaces. The Whisper server manager no longer tracks VAD availability or provides VAD detection. Transcription and cancellation IPC handling remain.

Changes

VAD support removal

Layer / File(s) Summary
Remove VAD contracts and IPC
electron/stt/transcriptionContract.ts, electron/stt/index.ts
The VAD response contract is removed, and the VAD error marker is replaced with STT_NATIVE_EXTRACTION_UNAVAILABLE. The STT manager and IPC registration no longer expose VAD detection.
Remove native and server VAD handling
electron/native/whisper-stt/src/main.cpp, electron/stt/whisperServer.ts, electron/stt/whisperServer.test.ts
The native /vad route and server-side VAD detection are removed. Server readiness and startup results no longer include VAD availability. Tests for VAD behavior are removed.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Refactor

Suggested reviewers: vitaligusatinsky

Merge Risk: ⚪ Minimal · up to c9470

The change removes an unused speech-detection interface while preserving transcription and inference VAD support. No actionable merge-blocking risk was identified; merge after normal checks pass.

Security Architecture Review

Security architecture risk: ⚪ Minimal · up to c9470

The change removes an unused speech-detection path while preserving transcription, local-only access, and existing startup and cleanup behavior. The reviewed changes do not widen access or weaken an existing security control.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The removed native route had independent loopback HTTP reachability when VAD was available, even though the supported renderer bridge could not invoke it. Its removal narrows the helper's request surface rather than expanding attacker-controlled input or authority.

Trust Boundaries and Controls

  • observed — The helper remains unauthenticated and relies on its existing loopback restriction; that condition predates this PR. Retained inference still validates WAV format, removes its temporary upload file, and serializes native inference with a mutex. The exact native diff changes none of these controls.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the removal of the unreachable /vad endpoint and stt:vad IPC path.
Description check ✅ Passed The description includes the required summary, related issue, change type, release impact, desktop impact, and testing details. The screenshots section is not needed because this is not a UI or visual…
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files.
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
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

@EtienneLescot
EtienneLescot merged commit 6fd9fb7 into main Sep 30, 2026
23 checks passed
@EtienneLescot
EtienneLescot deleted the claude/drop-vad-ipc branch September 30, 2026 21:59
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