fix(privacy): gate cloud usage reporting to OpenWhispr-cloud transcriptions - #1679
Open
xpipko wants to merge 2 commits into
Open
fix(privacy): gate cloud usage reporting to OpenWhispr-cloud transcriptions#1679xpipko wants to merge 2 commits into
xpipko wants to merge 2 commits into
Conversation
…ptions The streaming completion path reported usage to the OpenWhispr API for every provider, and the call carries sendLogs -- the transcript text. For BYOK providers, custom endpoints, and self-hosted servers the user has deliberately routed audio away from OpenWhispr's cloud, so shipping their transcripts back defeats the point. Providers now declare in the streaming registry whether their audio travels through OpenWhispr Cloud, and the session records the answer at connect time from the provider it selected and the mode it sent. Completion reads that instead of re-deriving routing from settings, which also stops a mid-dictation settings change from deciding where the transcript goes. The flag is opt-in, so a provider added later stays silent until someone states otherwise -- the failure mode of an oversight is a missing usage row rather than a leaked transcript. Corti and Tinfoil stream on the user's own credentials and declare nothing; local and self-hosted never open a streaming session at all.
Drives the real resolveStreamingProviderName, STREAMING_PROVIDERS registry and buildStreamingSessionOptions from a settings state, and asserts which combinations may report usage. Adding a backend without declaring cloudMetered, or flipping a BYOK provider to metered, fails here. Verified it catches the regression: dropping cloudMetered from openai-realtime fails the OpenWhispr-managed case.
xpipko
force-pushed
the
fix/streaming-usage-privacy-gate
branch
from
August 25, 2026 15:32
0b65ddb to
1646762
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The problem
The streaming completion path reported usage to the OpenWhispr API for every
provider, and that call carries
sendLogs— the transcript text itself.For BYOK providers, custom endpoints, and self-hosted servers the user has
deliberately routed audio away from OpenWhispr's cloud. Shipping their
transcripts back defeats the point of choosing those providers.
The fix
Providers declare in the streaming registry whether their audio travels through
OpenWhispr Cloud, and the session records the answer at connect time from the
provider it selected and the mode it sent:
Completion reads that recorded decision instead of re-deriving routing from
settings, so a mid-dictation settings change can no longer decide where the
transcript goes.
modeis read back off the objectbuildStreamingSessionOptions()built ratherthan re-derived, so the usage decision and the connect payload cannot disagree —
and if that builder ever changes how it resolves the mode, this follows
automatically.
The flag is opt-in. A backend added later stays silent until someone states
otherwise, so the failure mode of an oversight is a missing usage row rather
than a leaked transcript.
deepgramassemblyaiopenai-realtimeopenwhisprmodecortitinfoil-realtimeTests
test/helpers/audioManagerUsageGate.test.jsdrives production code rather thanrestating it: each case sets a settings state and runs the real
resolveStreamingProviderName(), the realSTREAMING_PROVIDERSregistry viagetStreamingProvider(), and the realbuildStreamingSessionOptions(), thenasserts which combinations may report usage. Six cases cover all five streaming
providers, including
openai-realtimein both modes.Confirmed it catches the regression it exists for: dropping
cloudMeteredfromopenai-realtimefails the OpenWhispr-managed case.It pins the gate's inputs, not the gate expression or its single consumer — both
sit inside
startStreamingRecordingpast the mic and worklet setup, where thereis no seam to call. So it catches a backend added without a decision, or a BYOK
provider flipped to metered; it would not catch the guard itself being deleted.
npm run lintclean, full suite green (2089 tests).