rohitsar567 Claude Opus 4.7 (1M context) commited on
Commit
24349be
Β·
1 Parent(s): 88e54a8

fix(voice): gate the PTT/Sarvam send-paths on uploadStatus + extractionInFlight too

Browse files

The voiceSubmitRef path (browser SpeechRecognition end-of-speech
auto-fire) was guarded in dfaa4d6 β€” but two OTHER voice send-paths
in the PTT recorder.onstop callback (L1289 srFallback + L1311 Sarvam
authoritative text) had no guard. If the user accidentally pressed
PTT during the upload + extraction window, or if a stray TTS
playback bled into the mic and the recorder picked it up, the
Sarvam transcription would still drop the resulting chat turn into
the middle of the wait β€” producing the "I can help with that!
Please tell me what you'd like to know" unprompted message reported
in screenshot #53.

Single early-return at the top of the PTT post-transcribe callback
now blocks ALL voice send-paths while uploadStatus || extractionInFlight.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Files changed (1) hide show
  1. frontend/src/app/page.tsx +12 -0
frontend/src/app/page.tsx CHANGED
@@ -1283,6 +1283,18 @@ export default function Page() {
1283
  // unknown). Prefer the SR fallback transcript when present so the
1284
  // turn still goes through; otherwise surface the friendly
1285
  // user_message and DO NOT call send() with empty text.
 
 
 
 
 
 
 
 
 
 
 
 
1286
  if (tr.error_code) {
1287
  if (srFallback) {
1288
  setInputFromTranscript(srFallback);
 
1283
  // unknown). Prefer the SR fallback transcript when present so the
1284
  // turn still goes through; otherwise surface the friendly
1285
  // user_message and DO NOT call send() with empty text.
1286
+ // ADR-044 β€” defensive: suppress voice-driven send() during the
1287
+ // upload-index window AND while the background LLM extraction
1288
+ // is still running. Even an explicit PTT press shouldn't drop
1289
+ // a chat turn into the middle of the wait β€” the user can
1290
+ // re-press once the card lands. Mirrors the voiceSubmitRef
1291
+ // guard for the browser SpeechRecognition path.
1292
+ const __voiceBlocked = uploadStatus || extractionInFlight;
1293
+ if (__voiceBlocked) {
1294
+ setInput("");
1295
+ maybeResumeLive();
1296
+ return;
1297
+ }
1298
  if (tr.error_code) {
1299
  if (srFallback) {
1300
  setInputFromTranscript(srFallback);