refactor: remove conditional voice mode support from backend and frontend#8597
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis change removes conditional support for "voice mode" across both backend and frontend. All checks, imports, and state related to whether voice mode is enabled are eliminated. The API, schemas, frontend state, and UI now assume voice mode is always present, with related toggles and detection logic removed. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Frontend
participant Backend
User->>Frontend: Loads application
Frontend->>Backend: GET /config
Backend-->>Frontend: Config (no voice_mode_enabled flag)
Frontend->>Frontend: Renders VoiceButton unconditionally
User->>Frontend: Clicks VoiceButton
Frontend->>Backend: Initiates voice-related API/WebSocket
Backend-->>Frontend: Handles voice mode features (no enablement check)
Possibly related PRs
✨ Finishing Touches🧪 Generate Unit Tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 2
🔭 Outside diff range comments (1)
src/backend/base/langflow/api/v1/endpoints.py (1)
747-755: Config response no longer filtered – verify sensitive/irrelevant fields aren’t leaking
settings_service.settings.model_dump()dumps the entire settings object.
Withvoice_mode_enabledgone this blob has grown relatively. Please confirm that the model does not contain secrets (API keys, DB URLs, etc.) or environment-specific info that shouldn’t be exposed over/config.If any such data exists, export only the whitelisted subset:
- return { - "feature_flags": FEATURE_FLAGS, - **settings_service.settings.model_dump(), - } + safe_settings = settings_service.settings.model_dump(include={ + "frontend_timeout", + "auto_saving", + "auto_saving_interval", + "health_check_max_retries", + "max_file_size_upload", + "webhook_polling_interval", + "serialization_max_items_length", + "event_delivery", + }) + return {"feature_flags": FEATURE_FLAGS, **safe_settings}
🧹 Nitpick comments (1)
src/backend/base/langflow/api/v1/voice_mode.py (1)
159-164: Add explicit return-type annotation for the new propertyMinor readability / typing nit:
- def barge_in_enabled(self): + def barge_in_enabled(self) -> bool:
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
src/backend/base/langflow/api/router.py(2 hunks)src/backend/base/langflow/api/utils.py(0 hunks)src/backend/base/langflow/api/v1/__init__.py(2 hunks)src/backend/base/langflow/api/v1/endpoints.py(1 hunks)src/backend/base/langflow/api/v1/schemas.py(0 hunks)src/backend/base/langflow/api/v1/voice_mode.py(4 hunks)src/frontend/src/controllers/API/queries/config/use-get-config.ts(1 hunks)src/frontend/src/modals/IOModal/components/chatView/chatInput/components/voice-assistant/components/voice-button.tsx(0 hunks)src/frontend/src/stores/flowsManagerStore.ts(0 hunks)src/frontend/src/types/zustand/flowsManager/index.ts(0 hunks)
💤 Files with no reviewable changes (5)
- src/backend/base/langflow/api/v1/schemas.py
- src/frontend/src/modals/IOModal/components/chatView/chatInput/components/voice-assistant/components/voice-button.tsx
- src/frontend/src/types/zustand/flowsManager/index.ts
- src/backend/base/langflow/api/utils.py
- src/frontend/src/stores/flowsManagerStore.ts
⏰ Context from checks skipped due to timeout of 90000ms (40)
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 32/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 40/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 37/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 35/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 39/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 28/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 29/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 30/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 31/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 38/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 36/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 27/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 34/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 33/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 25/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 24/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 23/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 26/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 17/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 21/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 13/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 22/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 14/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 9/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 15/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 18/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 10/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 12/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 19/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 8/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 1/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 11/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 2/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 16/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 5/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 4/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 20/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 6/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 3/40
- GitHub Check: Run Frontend Tests / Playwright Tests - Shard 7/40
🔇 Additional comments (2)
src/backend/base/langflow/api/v1/__init__.py (1)
17-18: Same startup-failure risk as inrouter.pyMake the import optional or document
websockets,numpy, etc. as hard requirements; otherwise deployments that never use voice mode will crash.Replicate the guarded import pattern suggested in
router.py.Also applies to: 36-37
src/frontend/src/controllers/API/queries/config/use-get-config.ts (1)
48-69: LGTM – front-end consumer cleaned up correctlyAll references to the removed
voice_mode_enabledflag are gone, and state setters stay in sync with the updatedConfigResponse.
No concerns here.
…tend (langflow-ai#8597) * revert changes that made voice mode conditional to the presence of webrtcvad * refactor: lazy-load webrtcvad dependency * refactor: remove try-except block and directly import voice_mode_router * [autofix.ci] apply automated fixes * feat: add LRU caching to voice activity detector initialization --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Summary by CodeRabbit
New Features
Refactor
Bug Fixes