DEV Community

Cover image for The update button that uninstalled a feature: a uv tool receipt story
Mohsen Seyedkazemi Ardebili
Mohsen Seyedkazemi Ardebili

Posted on AI-assisted

The update button that uninstalled a feature: a uv tool receipt story

My own install of my own dictation app lost its speech engine, and nothing told me. Nothing had crashed. The app started fine. yazses doctor said everything was OK.

But the engine I had enabled, NVIDIA's Parakeet, was gone. The app had quietly fallen back to the default Whisper model. And the thing that removed it was the app's own "Install update" button.

How the pieces fit

YazSes is an offline dictation tool. Many people install it with uv:

uv tool install yazses
Enter fullscreen mode Exit fullscreen mode

Heavy optional parts, like an alternative speech engine, aren't in the base install. You turn them on later:

yazses features enable stt-parakeet
Enter fullscreen mode Exit fullscreen mode

Under the hood, that ran a plain:

uv pip install --python <the tool's venv> onnx-asr
Enter fullscreen mode Exit fullscreen mode

It worked. Parakeet loaded. Everything was fine.

What uv tool actually remembers

When you uv tool install something, uv writes a receipt, uv-receipt.toml, inside the tool's environment. It records what the tool was installed with: the package, and any --with extras.

uv tool upgrade doesn't just bump one package. It rebuilds the environment from the receipt, and anything that isn't in the receipt is removed. Even on an upgrade where nothing changes version, it printed:

Modified yazses environment
 - onnx-asr==0.12.0
Enter fullscreen mode Exit fullscreen mode

My uv pip install had gone straight into the venv and never touched the receipt. As far as uv knew, onnx-asr was an intruder, and it cleaned it up. Correctly, from its point of view.

Both the tray's "Install update" and yazses update run uv tool upgrade yazses. So updating the app uninstalled a feature the user had enabled.

uv tool install, then a pip install that bypasses the receipt, then uv tool upgrade removes it, and doctor still says OK

Why nobody noticed

Two design decisions that are each fine on their own combined into a silent failure:

  1. Graceful fallback. If the configured engine can't load, YazSes logs a warning and uses faster-whisper instead of refusing to start. That's the right call; dictation still works.
  2. The health check checked the fallback. doctor verified that faster-whisper worked. It did. So: OK.

The only trace was one WARNING line in a rotating log file. A health check that only tests the fallback reports green in both the healthy and the degraded state, so it isn't telling you anything.

The fix, and the fix that would have caused a second bug

The obvious fix is to install extras the way uv wants: uv tool install --with onnx-asr yazses.

But --with doesn't add to the receipt's list. It replaces it. Enable Parakeet, then enable another feature with --with, and the second command silently drops Parakeet from the receipt. Same bug, one step later.

So the shipped fix (v2.37.2) reads the existing receipt, finds it through uv tool dir rather than a hard-coded path, and reissues the install with the union of what's already there and the new package. And doctor got a new check: if you configured Parakeet or Moonshine and it can't be found, that's a WARN, not an OK.

There's a follow-up on main, going out in the next release. Installs that enabled a feature before that fix still have an incomplete receipt. So the updater now checks, before upgrading, whether every enabled feature's packages are in the receipt, and if not, rewrites the upgrade as uv tool install --upgrade --with ... to repair it. It also preserves environment markers when it rewrites the receipt, and knows where uv keeps tools on Windows (%APPDATA%\uv\data\tools).

A cousin of the same bug

While I'm confessing uv surprises: a [tool.uv.sources] entry only applies to direct dependencies. I had pointed PyTorch at the CPU-only index for an optional feature, but torch came in transitively, so the source was silently ignored, and the lock went back to the CUDA build (about 4 GB). The fix was to list torch explicitly in that extra so the source applies. If your CPU-only torch pin "doesn't work", check whether torch is actually a direct dependency.

What I took away

  • If a tool's environment is defined by a manifest, every change has to go through the manifest. Installing around it works right up until the tool reconciles.
  • Read what a flag does to existing state. --with replacing instead of appending would have reintroduced the bug in a new shape.
  • Health-check the thing the user configured, not the thing you fall back to. Otherwise "graceful degradation" just means "invisible degradation".
  • A no-op update should be a no-op. If yours prints "Modified environment", read what it removed.

If you ship a CLI tool that people install with uv tool or pipx and that installs optional parts at runtime, it's worth checking what your next upgrade does to them.


YazSes is offline, open source (Apache-2.0) dictation for Linux, macOS and Windows: github.com/MSKazemi/yazses.

I wrote this with help from an AI assistant for drafting and editing; the bug, the fix and the opinions are mine, and I checked the facts against the code and changelog.

Top comments (0)