Skip to content

Aia vosk#111

Open
Astrowebdeving wants to merge 2 commits into
mainfrom
AIA-Vosk
Open

Aia vosk#111
Astrowebdeving wants to merge 2 commits into
mainfrom
AIA-Vosk

Conversation

@Astrowebdeving

Copy link
Copy Markdown
Collaborator

vosk fixes

Astrowebdeving and others added 2 commits May 20, 2026 19:01
…e path

The user reported that, in real-world wind conditions, recordings would
transcribe and render on screen but never reach Luna — the "Sent to Luna"
placeholder was never shown, the button silently flipped back to "Start
Recording", and crashes sometimes occurred right before sending.

Root causes addressed:

* RenderConversation only surfaced transientStatus when there were zero
  completed turns. After a single prior Luna exchange, every error path
  (FailActiveRecording / SetResponseStatus) was silently dropped, leaving
  the user staring at the previous turn. RenderConversation now appends
  a "[Status] ..." line below rendered turns whenever the status differs
  from the idle placeholder.

* ContainsCommandAlias used IndexOf substring matching, so wind
  hallucinations like "verge recording" matched the "urge recording"
  purge alias and silently nuked the prompt via CancelRecordingWithoutSubmit.
  Replaced with EndsWithCommandAlias — tokenized, end-of-utterance, word-
  boundary matching that only fires when the alias is actually the last
  word(s) of the utterance.

* Trailing send/purge command tokens were being submitted to Luna as
  part of the prompt. Added StripTrailingControlCommand which strips the
  longest matching alias from the end of the final transcript before
  forwarding ("what is procedure send recording" -> "what is procedure").

* Vosk's FinalResult() often comes back empty in wind even though the
  partial transcripts the user saw on screen had real text. Added
  TrySubmitFromLivePartial — when the final is empty or contains only
  control commands, fall back to the last live partial that was rendered.

* QueueAiRequest's previous cancel sequence was Abort()+StopCoroutine.
  StopCoroutine kills the coroutine that owns the UnityWebRequest's
  using block, so its Dispose() never ran, leaking native curl/SSL/socket
  resources every cancel. With an online orchestrator each leak was
  significantly larger (multi-second-long live request, full upload+
  download buffers) than the offline case, so wind-test record/cancel
  cycles eventually OOM'd the native heap and crashed the process — a
  strong candidate for the "crashes right before sending" report.
  Centralized cleanup in TerminateActiveAiRequest (Abort + Dispose +
  StopCoroutine, all wrapped in try/catch) and reused it from
  QueueAiRequest, DeactivateLuna, OnDestroy, and OnApplicationQuit.

* Bumped VoiceProcessor.MinimumSpeakingRmsValue from 0.0025 to 0.003 so
  sustained wind hiss (RMS ~0.0015-0.0028) no longer slips past the gate
  on a single peak-amplitude spike. Reduces the rate of bogus partials
  and therefore the rate of cancel-restart cycles that trigger the leak
  above.

* Added [Vosk][Submit] / [Luna][Submit] diagnostic logs on every silent-
  return path so the next adb logcat will show exactly which branch
  fires (purge alias, deactivated Luna, scene-route, empty final, etc.).

Files: Assets/AIA/AIAVoskInputController.cs
  Assets/AIA/VoiceIntents.cs
  Assets/Vosk/Scripts/VoiceProcessor.cs
Co-authored-by: Cursor <cursoragent@cursor.com>
@Astrowebdeving Astrowebdeving requested a review from hibaa8 May 21, 2026 00:16
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