Live transcript status reports 0 lines / 0:00 on Windows during a healthy in-app (Tauri) Live session
Bug: live transcript status reports 0 lines / 0:00 on Windows during a healthy in-app (Tauri) Live session
Summary
On Windows, live_transcript::session_status() returns line_count: 0 and
duration_secs: 0.0 throughout an otherwise-healthy in-app (Tauri) live
transcript session — even while utterances are being captured, transcribed, and
written to live-transcript.jsonl. Any UI that drives a timer or "is it
hearing audio?" indicator off those fields shows a frozen 0:00 and can trip a
false "no audio" state. macOS is unaffected.
Environment
- OS: Windows 10/11 (x64), WebView2
- Build:
cargo tauri build --features parakeet(release desktop installer) - Surface: in-app Tauri live transcript (the session runs on a background
thread inside the app process),
TranscriptSource::Standalone
Symptoms
- The session works end to end:
events.jsonlshowsrecording.started(source:"live") followed by multiplelive.utterance.finalevents, andlive-transcript.jsonlcontains the transcribed lines. - But
cmd_live_transcript_status/session_status()returnsline_count: 0,duration_secs: 0.0for the whole session. - (The UI still shows "recording" because that flag is tracked separately by the app, which is what makes the contradiction visible: clearly recording, yet 0 lines / 0:00.)
Root cause (Windows file-locking)
session_status() → derive_session_status() gates the stats on
standalone_active = lt_process_pid.is_some(), where
lt_process_pid = check_pid_file(&live_transcript_pid_path()).ok().flatten():
let should_report_stats = standalone_active || recording_pid.is_some();
let (line_count, duration_secs) = if should_report_stats {
status_metrics(live_status.as_ref(), jsonl_path, now)
} else {
(0, 0.0) // <-- Windows lands here
};
check_pid_file() reads the PID file with fs::read_to_string(path)?:
let pid_str = fs::read_to_string(path)?; // fails on Windows, see below
But the live session holds that same PID file under an exclusive fs2
lock for its entire lifetime (create_pid_guard → file.try_lock_exclusive()).
- On Unix,
fs2usesflock, which is advisory — a separateread_to_stringsucceeds, socheck_pid_filereturnsSome(pid)and stats report normally. - On Windows,
fs2usesLockFileExwithLOCKFILE_EXCLUSIVE_LOCK, which is mandatory. AReadFileon the locked byte range from another handle fails withERROR_LOCK_VIOLATION, sofs::read_to_stringreturnsErr,check_pid_filereturnsErr, and.ok().flatten()collapses it toNone. →standalone_active = false→ stats are forced to(0, 0.0).
So it's not that the session isn't running — it's that the status reader can't read the PID file while the writer holds an exclusive Windows lock on it, and the failure is silently mapped to "no active session."
This primarily bites the in-app case because the lock holder
(the app's background thread) and the reader (cmd_live_transcript_status on
the UI thread) are the same process polling concurrently. A separate-process
CLI reader may race differently but is exposed to the same hazard.
Impact
- Tauri Live mode timer / line-count / activity indicators freeze on Windows, which can look like a broken or non-capturing session.
- Anything polling
session_status()forline_count/duration_secson Windows is affected. Scoring/consumers that readlive-transcript.jsonldirectly are not affected (the JSONL isn't locked).
Suggested fixes (pick one)
- Make
check_pid_filetolerant of a locked-but-present PID file on Windows. Ifpath.exists()but the read fails with a lock/sharing error, treat the PID file as present rather than absent (or fall back to the liveness signal below) instead of returningErr. - Don't gate live stats on PID-file readability.
derive_session_statusalready has a fresh, heartbeated status sidecar (LiveStatus, withupdated_at+state: Healthy, written ~1×/s). Reportline_count/duration_secsfrom a freshLiveStatuseven when the PID read fails — the recording-sidecar path already uses sidecar staleness viaevaluate_recording_sidecar_status; the standalone path could do the same. - Avoid the self-read entirely: have the in-app session publish its line_count/duration via an in-process channel/shared state rather than round-tripping through a file the same process holds locked.
Option 2 is the most robust and reuses machinery already present.
Repro
- On Windows, start an in-app (Tauri) live transcript session and speak.
- Confirm
~/.minutes/live-transcript.jsonlis accumulating utterances. - Poll
session_status()/cmd_live_transcript_status→ observeline_count: 0,duration_secs: 0.0despite the growing JSONL.
Notes
Found while building a downstream feature on top of the live transcript. The
downstream UI worked around it by deriving its timer from wall-clock and its
audio-activity indicator from audioLevel (which isn't PID-gated), but the
underlying session_status() behavior on Windows is the real bug.
Fixed and shipped in v0.18.3. Your diagnosis was spot on: on Windows fs2 locks are mandatory, so the live session's own PID lock made check_pid_file's read fail and report the session as inactive, freezing status at 0:00.
The fix adds pid::inspect_pid_file, which treats a held lock as proof the owner is alive (Windows releases locks when the owning process exits), and routes every reader of a persistently-locked PID file through it. That also closes the related hazard you flagged where a concurrent recording could clobber live-transcript.jsonl, plus the CLI/Tauri stop, update guard, and background worker checks that shared the same blind spot. macOS and Linux were never affected.
Thanks for the unusually precise writeup, Quinn. It made the root cause obvious and shaped the whole fix. You're credited in the release notes and the merge commit (#259).
Upgrade path: brew upgrade minutes, the v0.18.3 desktop DMG, or npx minutes-mcp once the npm packages publish (lagging by a short window). Reopen if anything still looks off on your side.