-
Notifications
You must be signed in to change notification settings - Fork 210
add control mic option to SessionOptions #970
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughAdds Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
lib/src/agent/session.dart (1)
209-224:defaultMicrophoneEnabled=falseis bypassed whenpreConnectAudio=true(privacy risk).Lines 209-224: with the default
preConnectAudio=true, a user settingdefaultMicrophoneEnabled=falsestill activates the mic during pre-connect. This defeats the intent and can surprise users.✅ Suggested fix (gate pre-connect by defaultMicrophoneEnabled)
- if (_options.preConnectAudio) { + final bool shouldPreConnectAudio = + _options.preConnectAudio && _options.defaultMicrophoneEnabled; + + if (shouldPreConnectAudio) { dispatchesAgent = await room.withPreConnectAudio( () async { _setConnectionState(ConnectionState.connecting); _agent.connecting(buffering: true); return connect(); }, timeout: timeout, ); } else { _setConnectionState(ConnectionState.connecting); _agent.connecting(buffering: false); dispatchesAgent = await connect(); - if (_options.defaultMicrophoneEnabled) { + if (_options.defaultMicrophoneEnabled) { await room.localParticipant?.setMicrophoneEnabled(true); } }
🤖 Fix all issues with AI agents
In `@lib/src/agent/session.dart`:
- Around line 151-158: The options setter currently allows assigning any
SessionOptions which can diverge from the Session.room (which is final); modify
set options(SessionOptions value) to enforce that value.room matches the
instance's room (Session.room) — either by clamping value.room to this.room
before assigning to _options or by rejecting the assignment (throw/return) when
they differ; ensure you update the setter for options and use the existing
symbols (_options, SessionOptions, Session.room, notifyListeners) so the
session's room cannot become inconsistent with its options.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pubspec.lockis excluded by!**/*.lock
📒 Files selected for processing (2)
lib/src/agent/session.dartlib/src/agent/session_options.dart
🔇 Additional comments (1)
lib/src/agent/session_options.dart (1)
33-59: LGTM — option is wired through constructor and copyWith.The new default and propagation look consistent.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
514dc14 to
6645c2f
Compare
…k-flutter into nitin/control-mic
|
Draft |
Summary by CodeRabbit
New Features
Behavior Change
✏️ Tip: You can customize this high-level summary in your review settings.