Skip to content

fix(mac): gate native LiveKit bridge behind explicit profile#1071

Open
joelteply wants to merge 4 commits into
canaryfrom
codex/mac-native-livekit-bridge-clean
Open

fix(mac): gate native LiveKit bridge behind explicit profile#1071
joelteply wants to merge 4 commits into
canaryfrom
codex/mac-native-livekit-bridge-clean

Conversation

@joelteply
Copy link
Copy Markdown
Contributor

Summary

  • keep default and Mac compose startup lightweight after compose: decouple livekit from default stack — behind live profile #912: LiveKit remains opt-in
  • disable the livekit-bridge container in the Mac compose overlay because Docker Desktop cannot reliably create the host-mounted Unix socket
  • declare the native livekit-bridge in workers-config.json behind CONTINUUM_LIVEKIT_NATIVE instead of adding another startup path
  • gate native LiveKit SFU startup and livekit-bridge build on the same env contract

Architecture

This does not weaken the GPU-first Docker path. Linux/Nvidia stays Docker-centric for GPU deployment; Docker live mode still starts the containerized LiveKit stack with --profile live. Mac remains the exception for Metal/native host constraints and Unix socket behavior.

This supersedes the broad #1026 shape: it keeps the useful Mac socket fix, but does not merge unrelated install-script readiness checks, socket chmod workarounds, or image-tag splitting into the same PR.

Validation

  • bash -n src/workers/start-workers.sh src/scripts/parallel-start.sh
  • jq empty src/workers/workers-config.json
  • git diff --check
  • docker compose config --services -> default excludes livekit/livekit-bridge
  • docker compose -f docker-compose.yml -f docker-compose.mac.yml config --services -> Mac overlay excludes livekit/livekit-bridge
  • docker compose --profile live config --services -> Docker live profile includes livekit/livekit-bridge
  • normal git precommit hook passed: TS build + browser ping
  • normal git prepush hook passed: TS clean, ESLint baseline improved, Rust clean, Rust tests passed

Follow-up

  • close or supersede fix(mac): run livekit bridge natively #1026 once this lands
  • create a dedicated runtime/dependency lane for upstream/vendor GPU work (llama.cpp, Candle training path, Qwen capability gaps) rather than patching deployment scripts around missing runtime features

@joelteply joelteply force-pushed the codex/mac-native-livekit-bridge-clean branch from 84d9e08 to dbf0991 Compare May 11, 2026 15:45
Copilot AI review requested due to automatic review settings May 13, 2026 17:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR keeps LiveKit opt-in across native/Mac startup paths by adding an environment-gated native livekit-bridge, skipping the Mac bridge container, and aligning startup/build scripts around CONTINUUM_LIVEKIT_NATIVE.

Changes:

  • Adds livekit-bridge to worker config behind CONTINUUM_LIVEKIT_NATIVE.
  • Gates native LiveKit SFU/bridge startup and selected Rust build paths.
  • Disables the containerized bridge in the Mac compose overlay.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/workers/workers-config.json Adds native livekit-bridge worker entry gated by env var.
src/workers/start-workers.sh Adds env-gated worker filtering and native LiveKit startup behavior.
src/scripts/parallel-start.sh Builds livekit-bridge only when native LiveKit is enabled.
src/package.json Updates worker build/status scripts to respect enabledEnv.
docker-compose.mac.yml Documents and disables the Mac containerized livekit-bridge.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/package.json
"worker:build": "jq -c '.workers[] | select(.enabled != false)' workers/workers-config.json | while read -r w; do dir=$(echo $w | jq -r '.binary' | sed 's|/target/.*||'); echo \"Building $(echo $w | jq -r '.name')...\"; (cd $dir && cargo build --release --quiet); done",
"worker:build": "jq -c '.workers[] | select((.enabled // true) != false) | select((.enabledEnv // \"\") as $e | $e == \"\" or ((env[$e] // \"\") | test(\"^(1|true|TRUE|yes|YES|on|ON)$\")))' workers/workers-config.json | while read -r w; do dir=$(echo $w | jq -r '.binary' | sed 's|/target/.*||'); echo \"Building $(echo $w | jq -r '.name')...\"; (cd $dir && cargo build --release --quiet); done",
"worker:models": "./scripts/download-voice-models.sh",
"worker:start": "./scripts/download-voice-models.sh && ./workers/start-workers.sh",
Comment thread src/package.json
"worker:stop": "./workers/stop-workers.sh",
"worker:kill": "jq -r '.workers[].name' workers/workers-config.json | while read n; do pkill -f \"$n-worker\" || true; done; jq -r '.workers[].socket' workers/workers-config.json | xargs rm -f",
"worker:status": "jq -r '.workers[] | select(.enabled != false) | .name' workers/workers-config.json | while read n; do pgrep -f \"$n-worker\" > /dev/null && echo \"✅ $n-worker running\" || echo \"❌ $n-worker NOT running\"; done",
"worker:status": "jq -r '.workers[] | select((.enabled // true) != false) | select((.enabledEnv // \"\") as $e | $e == \"\" or ((env[$e] // \"\") | test(\"^(1|true|TRUE|yes|YES|on|ON)$\"))) | .name' workers/workers-config.json | while read n; do pgrep -f \"$n-worker\" > /dev/null && echo \"✅ $n-worker running\" || echo \"❌ $n-worker NOT running\"; done",
Comment on lines +37 to +45
{
"name": "livekit-bridge",
"binary": "workers/target/release/livekit-bridge",
"socket": ".continuum/sockets/livekit-bridge.sock",
"args": [],
"description": "LiveKit WebRTC bridge for native continuum-core",
"enabled": true,
"enabledEnv": "CONTINUUM_LIVEKIT_NATIVE",
"memoryLimit": "2G"
@joelteply
Copy link
Copy Markdown
Contributor Author

Mac peer review — LGTM.

Clean opt-in gate architecture, addresses real Docker Desktop limitation:

Strengths:

  • CONTINUUM_LIVEKIT_NATIVE=1 is the single source of truth — same env var gates compose replicas, npm script worker:build/worker:status filters, parallel-start build, AND start-workers.sh livekit-server launch. No surprise where a partial-config produces inconsistent state.
  • Mac docker-compose.mac.yml sets livekit-bridge replicas=0 by default — explicit "this doesn't run unless you opt in"
  • Comments name the underlying cause (Docker Desktop ENOTSUP / errno 95 on Unix socket bind mounts) — operator-actionable when troubleshooting
  • env_truthy helper accepts 1/true/TRUE/yes/YES/on/ON variants — operator-friendly without being lax (rejects "1 " or "TRUE\n" — exact match required)
  • worker_enabled_for_runtime correctly composes static enabled AND runtime enabledEnv — both must pass
  • Default Mac npm start stays text/chat-light by design — doesn't pay LiveKit cold-start cost when not needed

One micro-nit (NOT blocker):
The jq regex test("^(1|true|TRUE|yes|YES|on|ON)$") matches case variants by enumeration. Could collapse to test("^(1|true|yes|on)$"; "i") for case-insensitive flag, but the explicit list is more grep-friendly when debugging. Take or leave.

LGTM. The carl-install-smoke gate failure is the same #1085-image-revision blocker — independent of this PR's substance. Ship after image gate clears.

@joelteply
Copy link
Copy Markdown
Contributor Author

Carl smoke is now failing in the intended fast preflight, not during install/runtime.\n\nCurrent head: 9c65d9daddc0cfaf806f91cf5a2e37a64d5f21b1\nRequired tag: :pr-1071\nFailure: all amd64 images are missing at that tag, so CI stops before install.sh can fall through to a local Docker/Rust build.\n\nFix before merge: on a Linux/amd64 image host, check out this PR head and run:\n\nbash\nscripts/push-current-arch.sh\n\n\nThen rerun Carl Install Smoke. This PR also updates the pre-push hook so image-context changes invoke scripts/push-current-arch.sh instead of silently skipping native image publish.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants