Repository navigation
feat(perception): live-call video ingest → cognition (#192 see path) - #1963
Merged
Merged
Conversation
…ry viewer's perception (#192 core) The WRITE side of live-call perception, decoupled from LiveKit so it's testable without a live call. One decoded frame from a speaker fans out to each AI persona-viewer's PerceptionBuffer, keyed by the speaker's airc identity: - compute-once/share-many: builds the MediaFrame once; describe/scale run once per content-hash on the shared cache even across N viewers (the vision moat). - a persona never observes its OWN outbound avatar frame (self-skip on identity). - stateless: holds only the shared describer, never call/roster state — the live-call lifecycle owns "who is in the call" (not a parallel manager). 3 tests green (fan-out lands in every viewer, self-skip, empty-roster no-op). The transport wiring (bridge VideoFrame → mpsc → drain task → fan_out) lands next; its acceptance is a live two-persona call. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
The transport that feeds FrameIngest: a speaker's decoded frame now lands in
every AI-persona-viewer's PerceptionBuffer on a live call.
Path (all guide-compliant, no new thread, no parallel manager):
bridge reader thread (BridgeEvent::VideoFrame, already JPEG @ ~1fps)
→ perception_ingest::try_enqueue [non-blocking post onto a process-global
mpsc — the guide's "here is work" boundary; drops silently until the drain
is up]
→ drain task (spawned in VoiceModule::initialize, on the runtime)
→ VoiceService::video_viewers(call_id) [all AI Persona|Agent in the session;
NOT gated on is_audio_native — vision is universal; humans excluded]
→ FrameIngest::fan_out [compute-once/share-many; self-skip]
Seams:
- perception_ingest.rs: IngestFrame + INGEST_SINK OnceLock<mpsc Sender> +
install_channel() (drain owns the receiver) + try_enqueue() (bridge-thread safe).
- bridge_client.rs:731: the VideoFrame TODO-drop becomes a try_enqueue; the
human display plane (the LiveKit track) is untouched — this reads a copy.
- orchestrator/voice_service: video_viewers(session) roster query.
- modules/live.rs: VoiceState gets LateBound<CommandExecutor> (the #224 slot),
VoiceModule::install_executor fills it, initialize() spawns the drain. The
vision describer is built lazily once the executor is installed, then reused —
so N viewers of one frame share ONE describe.
Human frame rate is protected by construction: the ingest is a non-blocking
sample of a copy; PerceptionBuffer coalesces-to-latest + gates warms to ~2Hz, so
1fps in never becomes a describe storm and the display track never stalls.
51 tests green (fan-out ×3, video_viewers policy ×1, existing orchestrator/look
suites). cargo check clean. Acceptance = live two-persona call (see path).
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
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.
What
Wires the live-call video ingest into perception (#192): a speaker's decoded frame now lands in every AI-persona-viewer's
PerceptionBufferon a live call. This is the see half of the headless two-persona-call proof. Read side was already wired (supervisor →MediaPerceptionSource); this closes the write side.Path (guide-compliant — no new thread, no parallel manager)
Commits
IngestFrame+ mpscOnceLockboundary; thebridge_client.rs:731VideoFrameTODO-drop becomes atry_enqueue;video_viewersroster query;VoiceStategains aLateBound<CommandExecutor>(the Muted AI Spam Bug #224 slot) filled byinstall_executor, andinitialize()spawns the drain. The vision describer builds lazily once the executor is installed, then is reused — so N viewers of one frame share ONE describe.Human frame rate is protected by construction
The point you flagged. The ingest never touches the human display plane:
PerceptionBuffercoalesces-to-latest and gates warms to ~2 Hz per participant, so 1fps in never becomes a describe storm.describeruns on the served VL model's lane; compute-once means one inference per distinct frame regardless of viewer count.Tests
51 green (fan-out ×3,
video_viewerspolicy ×1, existing orchestrator +perception::looksuites).cargo checkclean.Acceptance = live validation (the see path)
Deploy + a two-persona (or human+persona) video call. Confirm: (1) human video stays smooth, (2) audio unaffected, (3) each persona's perception surfaces the other's frames (buffer populated, describe warms) — watch
perception_ingestfanned-N logs + the persona cognition log. #193 (call_id==room_id unify) is adjacent, not a blocker.🤖 Generated with Claude Code