Repository navigation
Desktop: speech recognition loads in a built app, so voice mode hears (#346) - #349
Merged
Merged
Conversation
Red first: the mic store must hand the VAD absolute asset URLs under the page's vad/ folder, and in the built app the e2e voice bar must reach data-mic="on" and "Say “Kurisu” to start" rather than "Speech recognition didn't load". Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014L9pxjp1MTSJe5DZG9A9sv
onnxruntime imports its .mjs relative to its own bundle, so the relative './vad/' pointed a built app at dist/assets/vad/, where nothing is, and voice mode heard nothing outside the Vite dev server (which answers those files at any path). The mic store now resolves the folder against the page and passes an absolute URL. The voice bar carries data-mic="on" once the recogniser is listening, so the e2e can wait for it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014L9pxjp1MTSJe5DZG9A9sv
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.
Closes #346
Cause
MicVAD.newwas givenbaseAssetPath/onnxWASMBasePathof'./vad/'. onnxruntime imports itsort-wasm-simd-threaded.mjsrelative to its own bundle, not the page, so in a built app (dist/index.html+dist/assets/index-*.js) it asked fordist/assets/vad/…, where nothing is: "no available backend found … Failed to fetch dynamically imported module". The Vite dev server hid it with a middleware that serves anyort-wasm*request by filename, whatever the path. So voice mode heard nothing in every build butelectron:dev— the e2e build and, by the same path logic, the packaged app and the browser build.Fix
micStoreresolves the folder against the page —new URL('./vad/', document.baseURI).href— and hands the VAD that absolute URL for both paths, so every loader means the same folder. The voice bar carriesdata-mic="on"once the recogniser is listening, which the e2e waits for.Tests
Written first (
c09f8fb), red before the fix:state/vadAssets.test.ts: the VAD gets absolute URLs under the page'svad/.VoiceModeBar.test.tsx:data-micsays whether the mic is on.voiceMode.spec.ts: in the built app, starting voice mode reachesdata-mic="on"and "Say “Kurisu” to start", never "Speech recognition didn't load". Red locally with the attribute but without the path fix (Received: "off"), green with it; the renderer log no longer shows the failed import.Locally: state 74,
voiceMode.spec.ts4/4 in Electron under Xvfb. The waiting state now renders in the real app and matches the mockup (1b).🤖 Generated with Claude Code
https://claude.ai/code/session_014L9pxjp1MTSJe5DZG9A9sv