Aia vosk#111
Open
Astrowebdeving wants to merge 2 commits into
Open
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
vosk fixes