* save recordings before transcription
* impart cj preferences
* cleanup
* re-transcribe anything
* format
* fix tests
* format
* ui cleanup
* format
* cleanup
* bunch of fixes, mainly for vm
* put comments back
* update transcription failure text
* alert -> toast
* spawn_blocking
---------
Co-authored-by: CJ Pais <cj@cjpais.com>
* fix: add SHA256 verification to prevent corrupt partial download loop
Fixes issue #858 — corrupt .partial files caused an infinite loop where
a failed/cancelled download would resume from EOF, pass extraction, and
loop forever with no way to recover without manual file deletion.
Three-part fix:
- Add sha2 crate and compute_sha256() helper; verify hash post-download
before extraction/rename for all 15 built-in models. Hash mismatch
deletes the .partial so the next attempt starts fresh.
- Delete .partial on extraction failure (independent of checksums) so
corrupt archives can't re-enter the loop via the same path.
- Emit model-download-failed event from the command handler so all
callers (ModelsSettings, Onboarding) get consistent error feedback
via a central store listener rather than per-caller return-value checks.
SHA256 hashes hardcoded alongside each model's URL in ModelInfo.
Custom models (sha256: None) skip verification silently.
* chore: remove doc comment from sha256 field
Doc comments on exported specta types propagate into bindings.ts as
inline JSDoc — not useful in generated TS. Removing at the source.
* test: add SHA256 verification unit tests
Extracts inline verify logic into ModelManager::verify_sha256() and
covers all four branches:
- None expected hash → skipped (custom models)
- Matching hash → ok, file kept
- Mismatched hash → error returned, partial file deleted
- Unreadable file → error returned
Ensures corrupt partial downloads are always cleaned up so the next
attempt starts fresh.
* chore: cargo fmt
* fix: clear cancel flag on sha256 failure, spawn_blocking for hash, fallback cleanup
- remove cancel_flags entry on sha256 failure to prevent a stale flag
from immediately cancelling the next retry attempt (HIGH)
- add fallback state cleanup in modelStore when result.status != ok,
so spinner clears even if model-download-failed event is missed (HIGH)
- run compute_sha256 in spawn_blocking to avoid stalling the async
executor while hashing large model files (up to 1.6 GB) (MEDIUM)
* emit some more events for the ui to pick up
* add translations + format
---------
Co-authored-by: CJ Pais <cj@cjpais.com>
sign-binaries: false passes empty strings for TAURI_SIGNING_PRIVATE_KEY
and APPLE_CERTIFICATE, but Tauri treats a set-but-empty env var as a
signing attempt, causing all builds to fail. Use sign-binaries: true to
match pr-test-build.yml — secrets are already configured in the repo.
* test build for 0.16.0
* macos 10.15?
* format
* shorter dir for build on windows?
* Update build.yml
* move
* Update build.yml
* long path support
* clang
* try
* try
* move to ort rc12
* use ms prebuilt?
* use lower version for 1.23.1
* download my prebuilt
* Update build.yml
* Update build.yml
* fix?
* fix(nix): use dynamic linking for ort-sys 2.0.0-rc.12
ort-sys rc.12 removed pkg-config support; without ORT_PREFER_DYNAMIC_LINK
it defaults to static linking against ORT_LIB_LOCATION, which fails
because nixpkgs only provides shared libraries (.so).
* fix(nix): override onnxruntime to 1.24.2 for ort-sys rc.12 compatibility
ort 2.0.0-rc.12 enables API v24 by default, but nixpkgs only ships
onnxruntime 1.23.2 (API v23), causing a runtime panic on model load.
Use Microsoft's prebuilt binaries for onnxruntime 1.24.2 via overlay,
patched with autoPatchelfHook for NixOS compatibility.
This overlay should be removed once nixpkgs merges onnxruntime ≥ 1.24:
https://github.com/NixOS/nixpkgs/pull/499389
* updated deps for whisper
* fix(nix): sync devShell with packages for ort-sys rc.12 compatibility
- Extract shared definitions (commonNativeDeps, gstPlugins, commonEnv,
onnxruntimeOverlay) to avoid duplication between packages and devShells
- Add onnxruntime 1.24.2 overlay to devShell (was only in packages)
- Add BINDGEN_EXTRA_CLANG_ARGS to devShell so bindgen can find stdio.h
and generate correct vulkan bindings for whisper-rs-sys
- Add ORT_LIB_LOCATION and ORT_PREFER_DYNAMIC_LINK to devShell
- Replace libappindicator with libayatana-appindicator in devShell
- Add onnxruntime and vulkan-loader to devShell LD_LIBRARY_PATH
* fix missing lib in the handy blob dl
* scope lib verification
* dont run bun2nix on windows
---------
Co-authored-by: Evgeny <evgeny.khudoba@yandex.ru>
* ci: add full build and quality checks on push to main
Adds a new main-build.yml workflow that runs the full 7-platform build
matrix on every push to main, uploading artifacts for 30 days. Also
adds push-to-main triggers to code-quality, test, and nix-check
workflows. The nix full build now always runs on main pushes (not just
when nix packaging files change), catching the expensive breakage that
currently requires manual verification before each release.
* ci: fix permissions and clarify nix full-build intent
- narrow contents: write to contents: read in main-build.yml — no
release assets are uploaded here so write access is unnecessary
- update nix-check comment to reflect that the full build always runs
on push to main (not just when nix files change), matching intent
* feat(audio): opt-in lazy stream close for bluetooth mic latency
keep the microphone stream open for 30s after recording stops to
reduce latency on back-to-back transcriptions. gated behind an
experimental setting (off by default) since it keeps the mic actively
capturing while idle — degrading bluetooth audio quality on macOS.
adds lazy_stream_close setting, tauri command, toggle in experimental
settings section, and i18n strings.
* fix: gate lazy close on setting in cancel_recording path
cancel_recording was unconditionally calling schedule_lazy_close,
keeping the mic open for 30s even when the setting was disabled.
also bump close_generation on AlwaysOn→OnDemand switch to cancel
any stale lazy close timers.
* feat(audio): opt-in lazy stream close for bluetooth mic latency
keep the microphone stream open for 30s after recording stops to
reduce latency on back-to-back transcriptions. gated behind an
experimental setting (off by default) since it keeps the mic actively
capturing while idle — degrading bluetooth audio quality on macOS.
adds lazy_stream_close setting, tauri command, toggle in experimental
settings section, and i18n strings.
* fix: gate lazy close on setting in cancel_recording path
cancel_recording was unconditionally calling schedule_lazy_close,
keeping the mic open for 30s even when the setting was disabled.
also bump close_generation on AlwaysOn→OnDemand switch to cancel
any stale lazy close timers.
* chore: fix cargo fmt on model.rs line from main merge
* fix race
---------
Co-authored-by: CJ Pais <cj@cjpais.com>
* fix: prevent idle watcher from unloading model during recording
the idle watcher treats ModelUnloadTimeout::Immediately as a 0s
timeout, causing idle_ms > 0 to always be true. this unloads the
model on the next 10s tick — even while the user is still recording.
the Immediately variant is already handled correctly by
maybe_unload_immediately() which fires after each transcription
completes. the idle watcher should skip it entirely.
fixes regression introduced in d1da935.
* fix race condition
* cleanup
* format
---------
Co-authored-by: CJ Pais <cj@cjpais.com>
* feat(audio): use device default sample rate and always downsample
instead of forcing the microphone to open at 16kHz (which can cause
issues with bluetooth codecs, some ALSA drivers, and other devices
that advertise 16kHz support but produce suboptimal audio), use the
device's native/default sample rate and let the existing FrameResampler
downsample to 16kHz for the whisper pipeline.
the resampling infrastructure (rubato FftFixedIn) already exists in
run_consumer() and short-circuits when in_hz == out_hz, so devices
that natively default to 16kHz are unaffected.
* fix: graceful fallback when supported_input_configs fails
some ALSA/PipeWire drivers support default_input_config but have
a broken supported_input_configs implementation. fall back to the
default config instead of propagating the error. also add a warn
log when no config matches the device's default rate.
* ci: reduce PR check time from ~30 min to ~1 min
- merge lint + prettier into single code-quality workflow
- add concurrency groups to cancel stale runs on rapid pushes
- add path filters so irrelevant changes skip checks
- make full nix build opt-in via "nix" label (eval-only by default)
- add nix store caching via magic-nix-cache-action
- cache trusted-signing-cli binary on windows builds
- upgrade setup-bun from v1 to v2
* ci: add workflow path filters and expand nix build triggers
- add .github/workflows/** to path filters on code-quality and nix-check
so CI runs when workflow files themselves change
- include tauri.conf.json and build.rs in nix full-build diff check since
these can break nix sandbox builds independently of cargo builds
- Default model_unload_timeout from Never to Min5
- Fix Drop impl: use take() on watcher handle so clones from
initiate_model_load() don't kill the watcher thread
- Reset last_activity on model load to prevent immediate unload
- Upgrade watcher logging from debug to info level
- Remove duplicate "unloaded" event (unload_model already emits it)
Co-authored-by: CJ Pais <cj@cjpais.com>
- Set ALSA_PLUGIN_DIR to PipeWire's alsa-lib path in package wrapper
(NixOS store paths aren't in ALSA's default plugin search)
- Add nixosModules.default: udev rule for /dev/uinput, systemPackages
- Add homeManagerModules.default: systemd user service for autostart
Co-authored-by: zitongcharliedeng <zitongcharliedeng@users.noreply.github.com>
* first pass at gpu acceleration
* unload the model when changing
* mock accelerator
* translations and build fix
* format
* clean up helptext
* type cleanup
* format
* lint
* refactor: migrate transcribe-rs from v0.2.8 to v0.3.0
Breaking API migration:
- engines::* → onnx::* module paths, whisper_cpp::* for Whisper
- TranscriptionEngine trait → SpeechModel trait
- Two-step new()+load_model() → one-step Model::load()
- transcribe_samples(Vec<f32>) → transcribe(&[f32])
- Explicit unload_model() → RAII drop
- Canary engine now from transcribe-rs instead of local crate
Removes canary-engine local crate dependency.
Uses path dependency to local transcribe-rs clone (temporary).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* feat: upgrade transcribe-rs to v0.3.1, add Canary models
Update transcribe-rs dependency from v0.2.8 to v0.3.1 with
restructured features (whisper + onnx). Add Canary 180M Flash
(4 languages, 146MB) and Canary 1B v2 (25 EU languages, 692MB)
with translation support. Add i18n translations for all 17 locales.
Languages verified against HuggingFace model cards:
- Canary 180M Flash: en, de, es, fr
- Canary 1B v2: bg, hr, cs, da, nl, en, et, fi, fr, de, el, hu,
it, lv, lt, mt, pl, pt, ro, sk, sl, es, sv, ru, uk
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* make sure when changing models the language changes with it
* format
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: CJ Pais <cj@cjpais.com>
Whisper supports an `initial_prompt` parameter that biases the model's
vocabulary during transcription. For Whisper models, we now join the
user's custom words list into a comma-separated string and pass it as
the initial_prompt. This guides the model to prefer those spellings
during decoding rather than relying solely on fuzzy post-correction.
For non-Whisper engines (Parakeet, Moonshine, SenseVoice, GigaAM),
the existing apply_custom_words post-correction continues to apply
since those engines don't support prompt-based vocabulary biasing.
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* fix(nix): replace manual hash management with bun2nix
Eliminate the recurring problem of Nix build hashes breaking whenever
bun dependencies change or the bun version in nixpkgs updates.
Changes:
- Add bun2nix flake input (pinned to v2.0.1) for per-package fetchurl
expressions from bun.lock, replacing the single FOD hash approach
- Use allowBuiltinFetchGit for cargo git dependencies, removing manual
outputHashes that required updates on every git dep change
- Add scripts/check-nix-deps.ts (cross-platform, runs via bun) that
auto-regenerates .nix/bun.nix when bun.lock changes, triggered by
the postinstall hook in package.json
- Update CI workflow to verify bun.nix is in sync and evaluate flake
- Remove scripts/update-nix-hashes.sh (no longer needed)
* style: format check-nix-deps.ts with prettier
* ci(nix): make nix-check job a required check
* fix(nix): address review feedback
- Fix bun2nix input pinning: use path syntax (github:owner/repo/tag)
instead of ?tag= query parameter so flake.lock records the ref
and `nix flake update` respects the pin
- Make check-nix-deps.ts exit with 0 on bun2nix failure so that
`bun install` is not blocked for non-Nix developers (CI validates
bun.nix independently)
- Fix stale reference to check-nix-deps.sh in flake.nix comment
* ci(nix): add full nix build step to CI workflow
Add `nix build .#handy -L --show-trace` after flake evaluation to
catch runtime build errors (broken dependencies, sandbox issues,
compilation failures) that flake eval alone cannot detect.
* fix(nix): update bun2nix pin from 2.0.1 to 2.0.8
bun2nix 2.0.1 has a bug in cache-entry-creator that causes
"ln: failed to create symbolic link '/p': Permission denied"
during the build. Version 2.0.8 fixes this.
* docs: add note about brew install not being directly maintained by devs
Added note about Homebrew cask maintenance and updated installation steps.
* fix
---------
Co-authored-by: CJ Pais <cj@cjpais.com>
* fix: show toast notification when model fails to load with ORT error
The model loading failure (e.g. ORT error) was only shown as a small
red dot with truncated text in the footer. Now it also triggers a
toast notification, matching how recording errors are already handled.
https://claude.ai/code/session_015VfQgoDkUDV6wk63RHrwEs
* fix: add missing i18n keys for model load error toast to all locales
https://claude.ai/code/session_015VfQgoDkUDV6wk63RHrwEs
* fix: simplify model load error toast and add proper translations
Remove the unnecessary modelLoadFailed passthrough key that just
forwarded a variable. Use the error string directly with a translated
fallback. Add proper translations for all 16 locales.
https://claude.ai/code/session_015VfQgoDkUDV6wk63RHrwEs
* fix: translate recordingFailed string in all locales
This was previously left untranslated (English) in all non-English
locale files.
https://claude.ai/code/session_015VfQgoDkUDV6wk63RHrwEs
* cleanup
* format
---------
Co-authored-by: Claude <noreply@anthropic.com>
* ui: improve scrollbar UI with custom colors and rounded thumb
* ui: increase scrollbar thickness for better visibility
* ui: refine scrollbar styling from primary pink to text/15 color and add custom buttons for scrollbar
* tweaks
---------
Co-authored-by: CJ Pais <cj@cjpais.com>
* Handle microphone start failures without aborting
Return recorder init errors instead of panicking/aborting in the worker thread and reset UI state when recording start fails.
Refs #436
* prop errors to ui
* format
* Add missing recording error translation keys
---------
Co-authored-by: CJ Pais <cj@cjpais.com>