Repository navigation
feat(hearing): carry the finals' times on the LiveKit transcription streams - #198
Conversation
Reviewer's GuideAdds end-to-end support for carrying final transcript start and end times through LiveKit attributes, replay, event parsing, and TranscriptLedger storage, with validation that only safe whole-millisecond decimal values are serialized or read. File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
…treams LiveKitTranscriptionOutput writes agentos.start_ms and agentos.end_ms on a final whose transcript has startMs and endMs, rounded to whole milliseconds, and a replay sends the times the final was first written with. transcriptEventFromLiveKit reads them back as numbers and ignores a value that is not whole milliseconds in decimal digits. The names are exported as TRANSCRIPTION_TIME_ATTRIBUTES from the voice pipeline's entries.
6edfb77 to
6238164
Compare
…_ATTRIBUTES The guide named the constant in the paragraph on @framers/agentos/io/hearing/livekit, which does not export it. It comes from @framers/agentos/io/voice-pipeline and its browser entry, beside TRANSCRIPTION_FAILED_ATTRIBUTE.
A final whose startMs is 0 is written with agentos.start_ms '0' and read back into a page's ledger line as 0. The writer, the reader and the ledger compare each time with undefined; this case keeps a truthiness check on any of them from dropping a line's start without a test failing.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
PR Summary by QodoPreserve final transcription times across LiveKit streams
AI Description
Diagram
High-Level Assessment
Files changed (7)
|
Code Review by Qodo
1. Negative start times appear as zero
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
Adds
agentos.start_msandagentos.end_msto a final's transcription stream, read bytranscriptEventFromLiveKit.LiveKitTranscriptionOutputwrites them besidelk.segment_id,lk.transcription_finalandlk.transcribed_track_idwhen the transcript carriesstartMsandendMs: the times on the session's audio clock, rounded to whole milliseconds and written in decimal digits (a time that is negative or not a safe integer once rounded is left out). An interim carries neither, a final without times carries neither, and a replayed final carries the two it was first written with.transcriptEventFromLiveKit()reads them into the event'sstartMsandendMs, so the lines of a page'sTranscriptLedgerhold the times; a value that is not whole milliseconds in decimal digits is ignored. The names are exported asTRANSCRIPTION_TIME_ATTRIBUTESfrom@framers/agentos/io/voice-pipelineand its browser entry, besideTRANSCRIPTION_FAILED_ATTRIBUTE. The voice pipeline guide's LiveKit section (docs/features/VOICE_PIPELINE.md) describes both.Linked issues
Closes #197
Type of change
How this was verified
Tests first, on CI: four cases in
LiveKitTranscriptionOutput.test.tsover a fake room (the two times beside the threelk.attributes; neither on an interim nor on a final without times; the same two on a replay, read back into a page's ledger; whole milliseconds) and three intranscriptLedger.test.ts(the times read as numbers; a value that is not whole milliseconds in decimal digits ignored while the other time is read; a page's ledger line holding the times its final carried). A fifth case inLiveKitTranscriptionOutput.test.ts, added after the change, writes a start of zero as'0'and reads it back into a page's line as0, so a check that takes zero for no time fails it.Six of those seven cases failed on the test-first commit (CI run 37957337228), every other test file passing: in
LiveKitTranscriptionOutput.test.tsthe two times beside thelk.attributes, the same two on a replay and whole milliseconds, and intranscriptLedger.test.tsall three. The seventh, neither time on an interim nor on a final without times, passed there because the writer wrote no times yet; it fails a writer that puts the times on an interim. The type check passed on that commit because the tests use the attribute strings ('agentos.start_ms','agentos.end_ms') directly, not the constant the change adds. All eight cases pass with the change. CI on the head: Test & Lint (lint, type check, the browser entry's import walk, the suite with coverage), Batch-1 gated tests and Release dry run (a patch release) are green.Migration notes
None: two new attributes on a final's stream, which a reader that does not know them ignores, and one new export.
Checklist
!before the colon for a change that breaks users (feat!:orfeat(api)!:).Summary by Sourcery
Carry valid final transcription timing through LiveKit streams into transcript ledger entries.
New Features:
Enhancements:
Documentation:
Tests:
Summary by CodeRabbit