Repository navigation
feat(berd-call): count speech requests by voice in call telemetry - #469
johnmatthewtennant wants to merge 8 commits into
Conversation
Signed-off-by: John Tennant <jtennant@block.xyz> Co-authored-by: Darcy <756b3e94a13d7979c09d32291e4fd4da46848bdaa53340021ac24fb843e28d57@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz> Co-authored-by: Darcy <756b3e94a13d7979c09d32291e4fd4da46848bdaa53340021ac24fb843e28d57@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz> Co-authored-by: Darcy <756b3e94a13d7979c09d32291e4fd4da46848bdaa53340021ac24fb843e28d57@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz> Co-authored-by: Darcy <756b3e94a13d7979c09d32291e4fd4da46848bdaa53340021ac24fb843e28d57@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz> Co-authored-by: Darcy <756b3e94a13d7979c09d32291e4fd4da46848bdaa53340021ac24fb843e28d57@buzz.block.builderlab.xyz>
Signed-off-by: John Tennant <jtennant@block.xyz> Co-authored-by: Darcy <756b3e94a13d7979c09d32291e4fd4da46848bdaa53340021ac24fb843e28d57@buzz.block.builderlab.xyz>
Co-authored-by: Darcy <756b3e94a13d7979c09d32291e4fd4da46848bdaa53340021ac24fb843e28d57@buzz.block.builderlab.xyz> Signed-off-by: John Tennant <jtennant@block.xyz>
Co-authored-by: Darcy <756b3e94a13d7979c09d32291e4fd4da46848bdaa53340021ac24fb843e28d57@buzz.block.builderlab.xyz> Signed-off-by: John Tennant <jtennant@block.xyz>
morgmart
left a comment
There was a problem hiding this comment.
🤖 Automated code review
Engineering review found no publishable changed-line defects in the exact three-dot comparison. The speech-usage event is derived from confirmed positive playback, remains deduplicated across resume and terminal races, carries the leased voice settings, is bounded and sanitized before telemetry aggregation, and is drained through shutdown before call completion. Protocol, documentation, and discriminating regression coverage are aligned. Supplied GitHub check evidence is structurally valid and all reported checks passed. Recommend APPROVE.
Deterministic publication result: 0 blocking and 0 non-blocking inline finding(s) publishable; 0 duplicate(s) suppressed; 0 blocking screenshot-evidence requirement(s) in this review body.
Pending checks: 1 check(s) are not complete.
This approval reflects the completed code review only; merge readiness remains governed by the repository's required checks.
Summary
Record how many speech requests actually used each voice during a Berd Call. The ended event adds
tts_voice_requests, an OTLP key/value list of catalog display names and numeric counts. The existingtts_voiceremains the starting default, and no per-speech telemetry event is added.Counts use the synthesis lease's resolved voice once the host confirms positive played frames, including per-request overrides. Interrupted speech counts once; resuming it does not add another request. Accepted chunks that never render do not count. Unknown voices are grouped as
custom. Shutdown continues processing audio acknowledgements, then drains the child event stream before finalizing counts.The client uses
berd-call-otlp-logs-v2. Gateway support must deploy before this client is released.Related issue
Extends the call telemetry introduced in #466. No duplicate per-voice count change found.
Testing
The end-event regression fails before the change and passes afterward. Real child-process regressions use loopback OpenAI speech and transcription fixtures to verify zero-playback cancellation, interruption with positive played frames, per-request voice overrides, and shutdown before the first chunk acknowledgement. Usage is emitted once for positive playback and omitted for zero playback. Unit regressions reproduce the cancellation and delayed-shutdown failures before their fixes and verify deduplication and event draining afterward.
A stopped-child regression verifies buffered admission events do not attempt a write after the child exits, while final events still drain. At
ae208a3b, a native Siri call completed two requests with Aaron and one with Zack, then stopped normally. Local OTLP capture contained exactly one started event and one ended event, with numerictts_voice_requestscounts{Aaron: 2, Zack: 1}, startingtts_voice=Aaron, andend_reason=user. Speech used native Siri and real audio devices; transcription used a silent loopback fixture, and telemetry stayed in a local capture service. The validation build changed only the telemetry destination and private data/lock roots.