Skip to content

fix(media): discover whisper.cpp models instead of a test fixture path - #124699

Merged
steipete merged 1 commit into
mainfrom
codex/autoqa-whisper-model-discovery
Aug 16, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/autoqa-whisper-model-discovery

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The auto local-STT selection hardcoded /opt/homebrew/share/whisper-cpp/for-tests-ggml-tiny.bin — a CI provisioning artifact — as the production whisper.cpp model default. Two silent failure modes:

  1. A real user with brew install whisper-cpp and properly downloaded ggml models got ready: false ("model file not found") because that exact test-fixture filename doesn't exist — voice notes silently fell through to no local transcription despite a working transcriber being installed.
  2. Machines provisioned by OpenClaw's own test setup did have the file, so real user audio was transcribed with the worst-quality tiny model, with nothing recording that a test artifact was selected.

Why This Change Was Made

Replace the fixture literal with discovery: scan the standard whisper-cpp install dirs (/opt/homebrew/share/whisper-cpp, /usr/local/share/whisper-cpp, /usr/share/whisper-cpp) for ggml-*.bin, preferring non-tiny models (larger = better transcription), deterministic name order within a tier. WHISPER_CPP_MODEL remains the explicit override. "Model file not found" now genuinely means no model is installed. The listDirectory seam is injected for tests, matching the module's existing resolveBinary/checkExecutable injection pattern.

User Impact

brew install whisper-cpp + any downloaded ggml model now works out of the box for local voice-note transcription; test fixtures no longer leak into production model selection.

Evidence

  • Two new regressions: discovery prefers ggml-base.en.bin over tiny + fixture names (fails pre-fix — old code picked the fixture literal), and no-models → ready: false with the existing reason string.
  • node scripts/run-vitest.mjs run src/media-understanding — 62 files, 934/944 pass (10 pre-existing skips).
  • tsgo core green.
  • LOC: prod +44/−4 (discovery helper + injected seam), test +41. Growth justified: replaces a broken constant with the capability it pretended to provide.
  • Codex autoreview (gpt-5.6-sol, high): clean, 0.99.

The auto local-STT default hardcoded
/opt/homebrew/share/whisper-cpp/for-tests-ggml-tiny.bin — a CI
provisioning artifact — as the production whisper model. Real users with
brew-installed whisper-cpp and downloaded models got ready: false
('model file not found'), silently skipping local transcription; test-
provisioned machines transcribed real audio with the worst-quality tiny
fixture with nothing recording that a test artifact was chosen.

Discover ggml-*.bin models across standard install dirs, preferring
non-tiny models; WHISPER_CPP_MODEL stays the explicit override. Not
found now genuinely means no model is installed.
@clawsweeper

clawsweeper Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 16, 2026
@steipete
steipete marked this pull request as ready for review August 16, 2026 17:09
@steipete
steipete merged commit 6509a09 into main Aug 16, 2026
275 checks passed
@steipete
steipete deleted the codex/autoqa-whisper-model-discovery branch August 16, 2026 17:22
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 17, 2026
openclaw#124699)

The auto local-STT default hardcoded
/opt/homebrew/share/whisper-cpp/for-tests-ggml-tiny.bin — a CI
provisioning artifact — as the production whisper model. Real users with
brew-installed whisper-cpp and downloaded models got ready: false
('model file not found'), silently skipping local transcription; test-
provisioned machines transcribed real audio with the worst-quality tiny
fixture with nothing recording that a test artifact was chosen.

Discover ggml-*.bin models across standard install dirs, preferring
non-tiny models; WHISPER_CPP_MODEL stays the explicit override. Not
found now genuinely means no model is installed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant