fix: only count usage minutes when words are actually transcribed #4680
+2
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
transcription_secondsregardless of whether any speech was actually transcribedRoot Cause
In
_record_usage_periodically()and thefinallycleanup block, the condition was:Since
transcription_secondsis wall-clock elapsed time (always > 0), usage was always recorded even whenwords_to_record == 0(no speech in that interval).Fix
Changed the condition to only record usage when words were actually transcribed:
The
transcription_secondsstill reflects the time window those words arrived in, which is a reasonable measure of active listening time — it just no longer records seconds for periods of pure silence.Test plan
🤖 Generated with Claude Code