Repository navigation
feat(live): several guests per link, tier choice (Standard/Premium/Enhanced) and the host's cloned voice - #444
Merged
Conversation
A Live Connect link used to admit exactly one guest. The host can now ask for `max_guests` 1-3 (default 1, `LIVE_MAX_GUESTS` lowers the ceiling) and the same link/QR admits guests one after the other, languages free. - migration 069: `live_sessions.max_guests` (guarded NOT VALID check); the guest-side unique index becomes a plain index under the same name so that re-running 065 stays a no-op. The owner-side unique index stays. - join_guest counts guests under FOR UPDATE on the session row, so N simultaneous joins admit exactly `max_guests`; `session_full` past that, the join window only closes a session nobody joined, and a join the engine cannot serve (each guest adds streams for every speaker) is refused `live_busy` inside the same transaction. - a guest hanging up in a multi-guest session leaves instead of ending it. - billing: every phone bills one stream per distinct target language, always, whatever the engine metadata says (the scale flag is gone from LiveMeter). - echo filter and latency probe: per-seat (4) mic levels, last-voiced and stamps; the pump resolves a speaker id to its seat; one utterance is one latency observation however many phones hear it. - dashboard list/detail: first guest plus `guest_count` instead of a scalar subquery that would 500 with several guests. - docs, spec and .env.example updated.
The host chooses 1-3 guests at setup (max_guests); the session machine, captions, partners panel, direction line and invitation panel now work with several partners, and a guest leaving a multi-guest conversation sees a "you left" screen without ending it for the others. 18 new i18n keys are copied in English to every locale until they are translated.
…andard The host chooses the tier when creating a Live Connect conversation (`engine`: standard by default, or gemini_live_translate). Every seat uses it and the owner pays every seat at that tier's rate per distinct target language. - create validates against the registry: engine_not_available, engine_not_supported_yet (Enhanced, client-direct), engine_not_allowed (business stays Standard); the tier is stored in live_sessions.engine_id and returned by create, join and GET session - GET /api/live/engines lists the selectable tiers with rate, minimum balance and a capacity hint - /ws/live resolves the engine per start from the conversation, not the default; the meter bills at that engine's rate - minimum balance scales with the tier's rate (same runway as Standard's minimum), at create and at every start - Premium at capacity moves the whole conversation to Standard: shared override in LiveState, stored engine_id updated, one engine_downgraded frame, a diagnostics event, and Standard's rate afterwards; never live_busy - admin transcript view exposes the engine id; docs and spec updated
…nnect-multi-guest-tiers
Enhanced (cartesia) is client-direct, so each phone runs Cartesia STT on its
own microphone and sends text, the server translates once per distinct other
language and addresses every listener, and each listener's phone speaks the
translation with Cartesia TTS.
- create accepts engine "cartesia" (consumer hosts, scaled minimum balance)
and voice_clone (per conversation, needs a clone and cloning enabled);
stored as live_sessions.use_voice_clone (migration 070)
- POST /api/live/sessions/{id}/enhanced/session mints the Meet-shaped token
for a host or a guest, rate limited per seat, conversation and address
- /ws/live: translate_text, enhanced_speak, enhanced_fallback; the owner pays
every seat at the Enhanced rate for accepted frames; a text-level echo
guard; the fallback moves the whole conversation to Standard
- GET /api/live/engines lists Enhanced with the user's voice clone state
Radio cards fed by GET /api/live/engines (Standard only while it loads or fails), remembered per browser and re-validated, disabled below the tier's minimum balance. The room shows the tier as a badge and a polite, dismissible notice on engine_downgraded; new create errors have friendly messages. The stored session gains an optional engine.
…nnect-multi-guest-tiers # Conflicts: # docs/live-connect.md
Live Connect gets the client half of Enhanced (Cartesia, client-direct): each phone runs Cartesia STT on its own microphone and sends text, the server translates, and each listener's phone speaks the translation with Cartesia TTS, in the host's cloned voice when the host opted in. - enhanced.ts: token before start and refreshed before expiry, STT on the phone's stream, partial coalescing (<= 5/s), stable segment ids, bounded TTS queue in arrival order, voice_id else default voice, every failure ending in enhanced_fallback / not_enhanced / gone - conversation: Enhanced vs PCM by session engine; engine_downgraded (or a 409) switches to PCM; the echo guard gates the recogniser while the phone speaks; full cleanup on mute/end/release/reconnect - picker: Enhanced card, hidden on restricted networks; host consent checkbox for the cloned voice and inline "Prepare my voice" - room: Enhanced badge, "Speaking" line, Enhanced-specific downgrade notice, a guest line about the host's imitated voice - shared with Meet without changing it: toCartesiaSession, ttsRequest, parseTtsFrame, openSttGraph/closeSttGraph (cartesia.ts) and recordVoiceSample (moved verbatim from app.ts to voice-sample.ts) - 9 new i18n keys in all 84 locales (English text)
…on going with a notice
… fallback, bound translation cost - billing: at most one opening charge per seat per interval, so a guest's start/stop loop can no longer drain the owner (Standard, Premium, Enhanced; user and org wallets). - enhanced: the text echo guard judges only 3+ words at >= 0.85 similarity, with 2.5 s / 4 s windows, and never drops a seat that was being played the other seat's words or that said it first; a short reply always goes through. - enhanced_fallback is honoured from the host only; a guest gets fallback_not_allowed (rate limited) and nothing changes. - translate_text cost: partials 2/s and cut to their last 400 characters, 2 translation calls in flight per seat, a per-conversation per-minute ceiling (LIVE_ENHANCED_CALLS_PER_MIN, default 600), finals reserved room. - LIVE_STATUS_CHECK_MS makes the 3 s status check testable. - tests: a flaky Standard tick read now polls; the Enhanced meter ending on the status check is pinned.
…nnect-multi-guest-tiers
…swers both phones with one sentence) and expect the new full-session message
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…k, so they can never deadlock in one process
This branch was successfully deployed
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.
Follow-up to the real two-phone test of Live Connect. Spec:
odd/tasks/live-connect-multi-tiers.md.What
max_guests, race-safe join). The host pays every seat, per distinct target language.engine_downgraded) and the tier's rate on every seat. Tier picker on the setup screen reusing Meet's wording.use_voice_clone); guests get a live-token-authorised Cartesia token; guests are spoken with the default voice; fallback to Standard.Verification
-D warningsclean on 1.97 and 1.98.1. Client: 2885 tests,astro check0 errors. Live e2e against the real server + mock Qwen: 6/6.Not verified
Real Cartesia, Gemini, Qwen, Groq and real phones (iOS audio rules, STT/TTS latency, token scope), real acoustics for the echo filters. A v1.62.1 binary refuses to boot against a DB migrated with 069/070 (
VersionMissing): roll the schema forward with the binary.