On-device dictation reports empty finalization timeouts as completed
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
Does this issue occur when all extensions are disabled?: Not tested; reproduced with controlled dependencies executing the source methods.
- VS Code Version: Eight-second fallback verified in 1.137.0 and 1.138.0 source; reproduction at `4fa9fcf245ad90eb1f21fae5ed0511515e068b1d`.
- OS Version: Windows; source-method reproduction, not a real-microphone test.
Steps to Reproduce:
1. Start local dictation with no transcript available and keep backend preparation/finalization pending in a test fixture.
2. Stop dictation and allow the eight-second finalization deadline to expire.
**Actual:** The backend is cancelled, no text is returned, and session telemetry records `completed`, `errorCode=""`, and `transcriptLength=0`.
**Expected:** Distinguish an empty timeout fallback from successful completion, while preserving the deadline and any useful partial transcript.
### Potential root cause
`_finishBackend()` warns on timeout and returns the streamed transcript without setting a timeout outcome. `_stopAndTranscribe()` therefore records `completed` even when the fallback is empty. Native `stop()` waits for model preparation too, so stopping before the model is ready can take this path.
Sources: [timeout fallback](https://github.com/microsoft/vscode/blob/4fa9fcf245ad90eb1f21fae5ed0511515e068b1d/src/vs/workbench/contrib/chat/browser/speechToText/chatSpeechToTextService.ts#L1540-L1557), [completion reporting](https://github.com/microsoft/vscode/blob/4fa9fcf245ad90eb1f21fae5ed0511515e068b1d/src/vs/workbench/contrib/chat/browser/speechToText/chatSpeechToTextService.ts#L1350-L1361).
A controlled reproduction exercised the actual eight-second deadline. This explains the empty timeout outcome, not why each affected session produced no transcript.
Contributor guide
Assessment
This issue has not been assessed yet.