Skip to content

fix architectural bug#322

Merged
AnkushMalaker merged 1 commit intodevfrom
fix/arch-bugfix
Mar 6, 2026
Merged

fix architectural bug#322
AnkushMalaker merged 1 commit intodevfrom
fix/arch-bugfix

Conversation

@AnkushMalaker
Copy link
Collaborator

@AnkushMalaker AnkushMalaker commented Mar 6, 2026

replaced instances of manual env file manipulation with dotenv

Summary by CodeRabbit

  • Documentation

    • Restructured audio pipeline architecture to emphasize plugin-driven design and streamlined data flows.
  • New Features

    • Added health checks for transcription and LLM services.
    • Introduced idle-detection for audio persistence to gracefully terminate after inactivity.
  • Bug Fixes

    • Improved session completion handling with atomic Redis updates.
    • Enhanced conversation restart logic to better handle disconnections.
    • Improved fallback transcription matching for precise context.
  • Configuration

    • Simplified environment variable management using standard tools.
    • Cleaned up default plugin configurations.
  • Tests

    • Updated registry deployment tests for GHCR support.
    • Enhanced health check endpoint validation.

replaced  instances of manual env file manipulation with dotenv
@AnkushMalaker
Copy link
Collaborator Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 6, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cea4c8bb-efc5-4605-8445-47bb58376694

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/arch-bugfix

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 6, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 6, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7773c2b3-5caa-483a-90a3-a27a107adba5

📥 Commits

Reviewing files that changed from the base of the PR and between c9154a3 and e8a8aad.

⛔ Files ignored due to path filters (1)
  • extras/speaker-recognition/uv.lock is excluded by !**/*.lock
📒 Files selected for processing (23)
  • Docs/audio-pipeline-architecture.md
  • backends/advanced/.env.template
  • backends/advanced/init.py
  • backends/advanced/src/advanced_omi_backend/controllers/session_controller.py
  • backends/advanced/src/advanced_omi_backend/controllers/system_controller.py
  • backends/advanced/src/advanced_omi_backend/controllers/websocket_controller.py
  • backends/advanced/src/advanced_omi_backend/llm_client.py
  • backends/advanced/src/advanced_omi_backend/routers/modules/health_routes.py
  • backends/advanced/src/advanced_omi_backend/services/audio_stream/producer.py
  • backends/advanced/src/advanced_omi_backend/services/plugin_service.py
  • backends/advanced/src/advanced_omi_backend/services/transcription/__init__.py
  • backends/advanced/src/advanced_omi_backend/services/transcription/base.py
  • backends/advanced/src/advanced_omi_backend/workers/audio_jobs.py
  • backends/advanced/src/advanced_omi_backend/workers/conversation_jobs.py
  • backends/advanced/src/advanced_omi_backend/workers/transcription_jobs.py
  • backends/advanced/upload_files.py
  • backends/advanced/webui/src/pages/System.tsx
  • config_manager.py
  • extras/openmemory-mcp/test_standalone.py
  • extras/speaker-recognition/pyproject.toml
  • scripts/lib/env_utils.py
  • tests/endpoints/health_tests.robot
  • tests/unit/test_docker_image_versioning.py

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting


📝 Walkthrough

Walkthrough

The PR refactors the audio pipeline architecture documentation toward a plugin-driven model, updates service health checks to be asynchronous with provider-specific validation, enhances environment variable handling using dotenv utilities across the codebase, improves transcription and worker logic with idle detection and error handling, and updates tests to reflect GHCR deployment instead of DockerHub.

Changes

Cohort / File(s) Summary
Documentation
Docs/audio-pipeline-architecture.md
Rewritten to emphasize plugin-driven architecture, streamlined Redis data modeling, condensed producer/consumer sections, removed granular step-by-step pipelines in favor of config-driven descriptions, and updated file path references.
Environment Configuration
backends/advanced/.env.template, config_manager.py, scripts/lib/env_utils.py
Removed plugin-related secrets from template; replaced manual .env parsing with dotenv_set_key and dotenv_values utilities across configuration management and script utilities.
Backend Health Checks
backends/advanced/src/advanced_omi_backend/llm_client.py, backends/advanced/src/advanced_omi_backend/routers/modules/health_routes.py
Made health_check() methods asynchronous; added actual provider-specific health validation (models.list() for LLM, HTTP/WebSocket handshakes for transcription); updated health status structure to include provider, type, and healthy flags.
Transcription Services
backends/advanced/src/advanced_omi_backend/services/transcription/__init__.py, backends/advanced/src/advanced_omi_backend/services/transcription/base.py
Added health_check() methods to batch and streaming providers with auth verification and error handling; introduced default optimistic health check in base provider.
Session & State Controllers
backends/advanced/src/advanced_omi_backend/controllers/session_controller.py, backends/advanced/src/advanced_omi_backend/controllers/system_controller.py, backends/advanced/src/advanced_omi_backend/controllers/websocket_controller.py
Refactored atomic Redis updates in mark_session_complete() using conditional mapping; replaced manual .env editing with dotenv_set_key; added fallback session matching logic using session ID prefix when client_id field is missing.
Audio Stream Producer
backends/advanced/src/advanced_omi_backend/services/audio_stream/producer.py
Removed TTL on sessions; removed mark_websocket_disconnected() method; enhanced finalize_session() to atomically set websocket_connected when disconnecting.
Plugin Service
backends/advanced/src/advanced_omi_backend/services/plugin_service.py
Replaced manual .env parsing with dotenv_values in load; added dotenv_set_key for persisting variables in save; removed line-by-line quoting logic.
Worker Jobs
backends/advanced/src/advanced_omi_backend/workers/audio_jobs.py, backends/advanced/src/advanced_omi_backend/workers/conversation_jobs.py, backends/advanced/src/advanced_omi_backend/workers/transcription_jobs.py
Added idle detection (5+ minutes inactivity) to audio persistence; refactored conversation job restart logic to check status explicitly; added optional conversation_id parameter to fallback transcription check, reduced max_runtime to 2 hours, and introduced transcription error detection and 60s no-activity watchdog.
Backend Initialization
backends/advanced/init.py
Added preservation of existing environment values during non-interactive setup; refactored prompts to multi-line format; ensured existing keys are retained for streaming providers, transcription providers, and LLM/memory services.
Upload Utilities
backends/advanced/upload_files.py
Replaced manual .env parsing with dotenv_get_key; enhanced error handling for missing tokens and authentication failures; added defensive checks for empty file lists; introduced explicit resource cleanup via try-finally for file handles.
Web UI
backends/advanced/webui/src/pages/System.tsx
Updated backend service display name mapping from 'audioai' to 'llm' → 'LLM'.
Tests
tests/endpoints/health_tests.robot, tests/unit/test_docker_image_versioning.py
Updated health tests to expect 'llm' service instead of 'audioai'; refactored Docker image versioning tests to reflect GHCR deployment defaults; updated environment handling to preserve CHRONICLE_REGISTRY and CHRONICLE_TAG when explicitly set; added new test cases for GHCR defaults, DockerHub backward compatibility, and CHRONICLE_REGISTRY precedence; removed dependency on DOCKERHUB_USERNAME.
External Tools
extras/openmemory-mcp/test_standalone.py, extras/speaker-recognition/pyproject.toml
Minor formatting and import reordering in test file; removed environment marker logic from pyannote.audio and torchcodec dependencies (unconditional entries).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/arch-bugfix

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@AnkushMalaker AnkushMalaker merged commit 94159b4 into dev Mar 6, 2026
1 of 2 checks passed
@AnkushMalaker
Copy link
Collaborator Author

166 tests, 147 passed, 0 failed, 19 skipped

@github-actions
Copy link

github-actions bot commented Mar 6, 2026

⚠️ Robot Framework Test Results (No API Keys)

Status: ❌ Some tests failed

ℹ️ Note: This run excludes tests requiring external API keys (Deepgram, OpenAI).
Tests tagged with requires-api-keys will run on dev/main branches.

Metric Count
✅ Passed 108
❌ Failed 4
📊 Total 112

📊 View Reports

GitHub Pages (Live Reports):

Download Artifacts:


View full workflow run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant