Repository navigation
fix(local): stage audio.cpp again when it lacks a curated family - #2279
Merged
Merged
Conversation
A checkout staged before canary_asr joined the pins kept its old server, because staging returned early whenever any server was staged. Choosing Canary 180M Flash then failed with 'unsupported model family hint: canary_asr'. Staging now probes the staged server once per curated family and compiles again when one is missing or the server does not start. Without --strict a stale server is kept, with a warning naming what it lacks, when no toolchain is installed, when the app holds the folder (checked before compiling) or when staging again fails, so pnpm dev goes on.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 7
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This branch was successfully deployed
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.
What
pnpm build:audiocpp(stage.mjs) now stages audio.cpp again when the staged server lacks a curated family. Before, it kept any staged server as it was.built-families.mjsreads each family's probe asbuilt,missing(the server refuses it by name) orunknown(the server never got that far).verifyBuiltFamiliesnow puts the server's own output in its error.New
staged-server.mjsdecides whether the staged server isabsent,currentorstale.stage.mjskeeps a current one and stages a stale one again.Without
--strict, a stale server is kept, with a warning naming what it lacks, in three cases:electron/audiocpp/(checked before compiling, so no 5-minute compile is wasted);pnpm devthen goes on with every family the server has. With--strict, as in CI and release, each case fails.packaging.mdand the proposal describe the rule.Why
#2273 added Canary 180M Flash (
canary_asr) toFAMILIES. A checkout staged before that kept its old server, so choosing Canary failed on every phrase:Developers had to know to delete
electron/audiocpp/by hand. Canary was also measured only on an Apple M2, where staging downloads upstream's archive, which has every family. This PR is the first time it was compiled and run on Windows.Fixes #
How to test
Unit tests:
node --test scripts/audiocpp/*.test.mjs scripts/msvc-runtime.test.mjsinsurfsense_local/electrongives 27 pass. The new tests cover the three probe verdicts and the absent, current, stale and did-not-run decisions.On Windows (Ryzen 7 5800X, MSVC 19.42, MinGW CMake first on PATH), with the old four-family build staged:
stage.mjssaid "was built without canary_asr; staging it again". It compiled all five families in 4.5 min, and a rerun said "already staged".--strictit exited 1.Canary on that Windows build, through the app's own path: the engine wrote
transcription.json, the sidecar's flags were used,AudioCppTranscribersent the Settings language, andcleaned()ran.Peak memory was 718 MiB. The silent warm-up with no language succeeds.
Packaging test:
tests/packaging/test_audiocpp_transcription_config.py[canary-180m-flash]passes against this build.High-level PR Summary
This PR fixes an issue where the audio.cpp build staging script would keep an outdated server that was missing newly added model families (like
canary_asr), causing runtime errors. The build system now probes staged servers to verify they contain all curated families and automatically re-stages when families are missing. In non-strict mode, stale servers are kept with warnings when toolchains are unavailable or compilation fails, allowing development to continue with existing families. The change includes comprehensive unit tests and updates documentation to reflect the new behavior.⏱️ Estimated Review Time: 5-15 minutes
💡 Review Order Suggestion
surfsense_local/electron/scripts/audiocpp/built-families.mjssurfsense_local/electron/scripts/audiocpp/built-families.test.mjssurfsense_local/electron/scripts/audiocpp/staged-server.mjssurfsense_local/electron/scripts/audiocpp/staged-server.test.mjssurfsense_local/electron/scripts/audiocpp/stage.mjsdocs/architecture/packaging.mddocs/proposals/local-speech-to-text.mdSummary by CodeRabbit