fix(audio-input): open-source returns the actually-bound device (read-back)#650
Open
byrongamatos wants to merge 1 commit into
Open
fix(audio-input): open-source returns the actually-bound device (read-back)#650byrongamatos wants to merge 1 commit into
byrongamatos wants to merge 1 commit into
Conversation
…-back)
openInputSource() surfaces the provider's bound device on the command return
(payload.bound = { type, name }) for the trusted in-process caller, so a silent
wrong-device substitution can be detected. Kept out of the redacted source-opened
event + diagnostics snapshot (raw device names are PII). Purely additive.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What & why
The companion core half of the macOS wrong-mic fix. The desktop half (stable name-based input identity + fail-loud open, so picking BlackHole can't silently fall back to the internal mic) is already on `main` (
src/renderer/screen.js). This adds the matching core contract so a caller can see which device actually bound.openInputSource()(static/capabilities/audio-session.js) now surfaces the provider's bound device on the command's return value aspayload.bound = { type, name }, for the trusted in-process caller — enabling an honest "Now listening to: " readout and detection of a silent substitution.How
source.openhandler may returnpayload: { boundType, boundName }(the merged desktop handler already does).openInputSourcethreads it onto the_handled(...)return only.source-openedevent and the diagnostics snapshot (both stay redacted) — mirroring howlist-sourcesreturns the devicelabelverbatim to the UI but pseudonymizes it in diagnostics.boundis omitted when the provider reports nothing.Scope note
This PR is read-back contract only — no input-setup meter. The live "we can hear you" meter that would consume
boundis intentionally not included here: it surfaced an unrelated audio-quality regression on re-enable during tester runs and is being reworked separately. Soboundcurrently has no in-tree consumer yet; it's groundwork + makes the desktop handler's read-back reachable.Verification
node --test tests/js/audio_session_input.test.js→ 39/39, incl. a new test asserting the read-back reaches the caller but is absent from the event + snapshot.Notes
🤖 Generated with Claude Code