App can terminate a CLI-started recording via stop sentinel when app and CLI versions differ
Summary
When the desktop app and CLI are on different versions but share ~/.minutes, the app can terminate
a recording started by the CLI, even when the app itself is not recording anything.
Split out of #792 for separate tracking.
Environment
- macOS 26.6.1 (25G76), Apple Silicon
- Minutes.app 0.25.1
- CLI 0.18.2 (a hand-installed binary at
~/bin/minutes-macos-arm64, not managed by the app) - Shared state directory:
~/.minutes
What happened
A CLI recording started successfully and was capturing correctly (readiness probe passed, both stems growing, verified real signal in each). It then died after 202 seconds with:
INFO stop sentinel detected — stopping dual-source recording
The recording did not crash, hit a timeout, or lose its audio source. It was told to stop.
At the same time, the app itself was capturing nothing: no recording.pid,
recording-start.txt or recording-meta.json, no audio file created anywhere under $HOME, and
lsof on the app pid showed no audio file open. minutes status agreed (recording: false).
Quitting the app resolved it, and CLI recordings then ran to completion (one ran 82 minutes without interruption).
Why it matters
The failure mode is silent and destructive in the same way as the issues in #792: the recording ends mid-meeting with no user-visible signal, and the loss is only discovered afterwards. For anyone using the CLI for capture (scripted or automated recording) while the desktop app is installed and running, a version mismatch can silently end recordings.
Suggested handling
Some form of guarding around the shared state contract, for example:
- Write a version/owner marker alongside the stop sentinel and ignore sentinels not intended for the current recording's owner
- Have the app skip writing a stop sentinel when it has no active recording of its own
- Warn on startup when the app detects a CLI binary with an incompatible version sharing
~/.minutes
Note on a related symptom I could not confirm
In the same session, the 0.25.1 app appeared to show a recording in progress while writing nothing to disk for several minutes. I initially attributed this to a separate "0.25.1 does not record" bug, but I could not reproduce it afterwards: on a later day the same app version recorded four times in a row without issue. It may have been UI state showing armed-but-not-recording, or a side effect of the version skew above. Mentioning it only for completeness, not as a claim.
Thanks for splitting this out, and for the retraction note at the bottom, which is as useful as the report.
A fix for this has been sitting on a pushed branch since yesterday without a PR, which was my mistake, not a deliberate hold. It is now #805.
Short version of what it does: refuse to signal a foreign recording when the app believes it is recording, because that combination means two different recordings and the wrong one is about to be stopped. Signal in every other case, so stopping a CLI recording from the tray keeps working, which is a real feature rather than an accident.
On your three suggestions, the middle one is close to what landed but not identical, and the difference is load bearing. Skipping the sentinel whenever the app has no recording of its own would break tray-stop. The condition used is narrower: the app thinks it is recording and the recording is not ours.
Your first suggestion, an owner marker on the sentinel that readers check, is the stronger design and I want it as well rather than instead. What is in #805 guards the writer, and only in the state you observed. A marker guards the reader, which also covers writers nobody has thought of, including builds that predate any fix, which is exactly your version-skew scenario. That is a shared-state contract change and deserves its own PR.
On the retracted symptom: that matches what I found. Reading the code I could not construct a path where the app sets its recording flag without a PID file existing, which is why I asked for logs rather than guessing at a fix. Treating it as withdrawn unless it recurs, and that leaves the mic stem dying after a default input device change as the only thing still waiting on your logs.
Completed by #807, which landed both protections together: the writer refuses a stale desktop-owned stop against a foreign recording, and the stop sentinel is addressed to the inspected recording PID. Main commit: a22292026ae3ba73fd086ff87581fa10292a2c4d. Post-merge main CI passed.