Repository navigation
fix(cli): transcribe names why whisper is missing and the one line that fixes it - #7366
Conversation
There was a problem hiding this comment.
Verdict: REQUEST CHANGES · 1 blocker · 0 important · 0 nits · head 7f201a32
- blocker (process): this is a fix PR, but the body has no
fails without the fix:line naming a test. The Test plan only says "They fail with manager.ts reverted to main". Please add a line likefails without the fix: manager.install.test.ts "names the missing build tool…", "gives a Linux user…", "gives a Windows user…" (3 failed on main).
The claim itself checks out: with main's manager.ts those 3 tests fail, and at head all 5 pass. I found no code blocker. Adding the line to the body is all that's needed for approval.
Scope
Read manager.ts (the cause collection, findBuiltBinary .exe/Release lookup, install lines) and traced the message through api/transcribe.ts → reportWhisperUnavailable, so the cause reaches the user. Build stderr is already capped at 500 chars. CI was still running when this was posted.
|
Added the |
What
When
transcribefinds no whisper and cannot make one, the error now says why (for example "cannot build whisper.cpp: cmake not found on PATH", or the brew or build error) and gives one runnable line to fix it. On Linux that line issudo apt-get install -y git cmake build-essential ... then re-run; on Windows it is awinget installline for Git, CMake and the VS Build Tools (or the upstream prebuiltwhisper-bin-x64.zip, about 9 MB, viaHYPERFRAMES_WHISPER_PATH). Also fixes a Windows build that succeeded but was never found: the Visual Studio generator writesbuild/bin/Release/whisper-cli.exe, and the lookup only triedbuild/bin/whisper-cliwith no.exe, so the result was "Build completed but whisper-cli not found" (swallowed before this PR).Why
A fresh Linux box ends with
whisper_unavailableand, where Parakeet is unsupported (glibc older than 2.32), only a URL to follow. The brew and build failures were swallowed inensureWhisper, so the real cause was never shown. Reproduced on a clean HOME on Ubuntu 20.04 with no cmake on PATH:npx hyperframes@latest transcribe a.wavprints "Captions skipped — whisper-cpp not found ... requires cmake", exit 1, and--jsongives{"reason":"whisper_unavailable"}.Related work
Refs the Discord report "Use your own voice recording" (transcribe fails with whisper_unavailable on a fresh install). This PR is the error half only. Whether a fresh box should fetch an engine itself (a prebuilt whisper.cpp, or Parakeet at about 670 MB) is a size decision and is not in this PR.
How
ensureWhispercollects each attempt's failure (brew, missing git or cmake, build error) into theWhisperUnavailableErrormessage.getInstallInstructionsreturns a runnable line on Linux. Searched for an existing helper that formats install causes: none (grep -rn "getInstallInstructions" packages/cli/srcfinds only manager.ts and doctor.ts, which gets the new line too).Test plan
whisper/manager.install.test.ts"names the missing build tool when whisper.cpp cannot be built", "gives a Linux user one runnable line to get a working engine", "gives a Windows user one runnable winget line, and finds a Release-built whisper-cli.exe" (3 failed with main'smanager.ts, 5 pass at head).whisper/manager.install.test.ts(names the missing cmake; Linux line; Windows winget line and a Release-builtwhisper-cli.exeis found). They fail with manager.ts reverted to main.manager.install.test.tsandapi.test.tspass on a remote box: 26 passed, exit 0.transcribe --engine whisper --model tiny.enon a spoken clip made with Windows speech synthesis): https://github.com/heygen-com/hyperframes/actions/runs/42398726579. main (job 128481661333) endsCaptions skipped — whisper-cpp not found. Install: Build with cmake: ..., exit 1. This head (job 128481661473) builds whisper.cpp, findswhisper-cli.exe, and writes the words ("Hello", "from", "Hyperframes.", ...). The runner already has git and cmake, so the missing-cmake path and the winget line itself were not run there.Size
A lone error-message fix that nothing else carries: the engine-fetch half is held for a size decision, and the own-recording work is a separate PR.
Not run: a real Windows machine (the Windows box was unreachable); the winget ids exist in microsoft/winget-pkgs (Git.Git, Kitware.CMake, Microsoft.VisualStudio.2022.BuildTools). The Windows test mocks the platform.