Commit Graph
32 Commits
Author SHA1 Message Date
didar 9e4c47eddd feat: enhance AudioSocketMediaRuntime to skip filler acks for closing intents and throttle repeated filler acks
deploy / deploy (push) Successful in 30s
2026-08-30 11:30:55 +05:00
didar 2ea6e6f4bb feat: update AI voice settings for improved responsiveness and pacing
deploy / deploy (push) Successful in 31s
2026-08-25 01:42:10 +05:00
didar 6ccdaf9167 feat: update ElevenLabs TTS model ID and add prebuffering for improved audio streaming
deploy / deploy (push) Successful in 31s
2026-08-25 01:20:52 +05:00
didar c399296165 feat: implement no-speech reprompt functionality with configurable parameters
deploy / deploy (push) Successful in 33s
2026-08-24 14:17:00 +05:00
didar 8dd3e238f2 feat: enhance low signal transcript handling with finalization checks and logging
deploy / deploy (push) Successful in 31s
2026-08-23 12:40:59 +05:00
Didar KozhikovandClaude Sonnet 5 49489f89b5 Play a filler ack during slow voice decisions and cache KB search rows
Two independent latency fixes for the voice-assistant reply pipeline,
both scoped to the parts of the flow that run regardless of whether
voice_v2 is enabled for a queue:

1. media_runtime._process_utterance: the v1/fallback turn path (used by
   any queue not covered by AI_VOICE_V2_QUEUE_CODES) silently awaited the
   full LLM decision with no audio playing at all, unlike the v2 path
   which already has a decision-timeout ack. Give v1 the same behavior:
   wait up to 600ms (_v1_ack_wait_seconds) for the decision, and if it's
   still not ready, play a short "Секунду." filler via the existing
   _emit_early_ack before the real reply, instead of leaving the caller
   in silence for the full LLM+TTS round trip. Reuses the same ack
   selection/playback code path v2 already exercises, so no new failure
   modes - just an added timeout branch mirroring the existing v2 one.

2. ai_orchestrator_service._kb_search: every voice/chat turn re-ran a
   full-table scan of kb_articles (all columns, including body text) and
   rescored every row in Python, even though the KB rarely changes
   mid-conversation. Added an in-process cache keyed by language, gated
   on a cheap content fingerprint (row count + max id + max updated_at +
   summed title/body/tags length, all computed server-side without
   transferring the text columns). A fingerprint mismatch always
   triggers a fresh fetch, so this can never serve stale results after
   an insert/update/delete - unlike a naive TTL cache, which would have
   been be wrong the moment a test (or a real KB edit) changed the table
   within the cache window.

   Note the first fingerprint design (count + max id + max updated_at
   only) was insufficient: utc_now_iso() truncates to whole seconds and
   SQLite reuses primary keys after a full-table delete, so two
   different row sets written in the same wall-clock second could share
   a fingerprint. Caught this via a real test failure
   (test_ai_whatsapp_relaxed_kb_search_answers_phrase_query breaking
   only when run after test_ai_orchestrator_service.py in the same
   process) before it could reach production; the summed content-length
   term closes the gap.

Added test_media_runtime_plays_filler_ack_when_v1_decision_is_slow
(asserts greeting -> ack -> reply delivery order when process_turn is
slow) and verified the KB cache against the full
test_ai_orchestrator_service.py + test_ai_whatsapp_orchestrator_service.py
suite plus a wider kb/orchestrator/whatsapp/telegram/voice-filtered run:
only the same pre-existing, already-documented failures remain (unrelated
sales_service test-isolation ordering, one known persona-prompt
assertion) - no new failures from either change.

Streaming the LLM decision itself (start speaking reply_text before the
full structured JSON response finishes generating) was scoped but
deliberately deferred: it needs incremental JSON parsing on top of SSE
streaming to detect when just the reply_text field is complete, shared
across both voice and text-channel decision paths - a separate,
higher-risk change that deserves its own PR and testing pass rather than
being bundled here.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-19 21:54:02 +05:00
Yera All aa64b6b94c Revert "feat(voice): start early replies before final asr"
This reverts commit a44a1b97a1.
2026-04-19 01:30:26 +05:00
Yera All 224973d840 Revert "fix(voice): race slow streaming asr finalize"
This reverts commit 77df41bce0.
2026-04-19 01:30:26 +05:00
Yera All 77df41bce0 fix(voice): race slow streaming asr finalize 2026-04-19 01:06:03 +05:00
Yera All a44a1b97a1 feat(voice): start early replies before final asr 2026-04-19 00:46:16 +05:00
Yera All 9cd553bf92 feat(voice): start replies from stable streaming partials 2026-04-19 00:13:58 +05:00
Yera All 4adaf192fb fix(voice): avoid silence on ASR runtime failures 2026-04-17 01:28:06 +05:00
Yera All 39096e114f fix(voice): harden noisy streaming turns 2026-04-17 00:30:41 +05:00
Yera All aa6f838061 fix(voice): keep asr partial polling off push path 2026-04-17 00:06:27 +05:00
Yera All 52b2edfcd3 fix(voice): stop thinking continuation on silence 2026-04-16 23:56:10 +05:00
Yera All f14aeb39df test(voice): wait for async streaming asr push 2026-04-16 23:48:07 +05:00
Yera All d331981ac8 fix(voice): decouple streaming asr from media loop 2026-04-16 23:11:24 +05:00
Yera All 5af47991dc fix(voice): stabilize turn finalization after asr timeouts 2026-04-16 02:30:39 +05:00
Yera All 989bf9a0c1 fix(voice): stabilize v2 streaming topic handling 2026-04-12 21:59:32 +05:00
Yera All 7f4c80add1 test(voice): align runtime expectations with v2 fallback 2026-04-12 21:32:49 +05:00
Yera All 57bd5cad4b fix(voice): suppress low-signal turns and false lookup replies 2026-04-12 20:40:25 +05:00
Yera All f2ece35588 fix(tests): isolate db state and stabilize voice runtime suite 2026-04-12 11:38:02 +05:00
Yera All e581d48c44 test(voice): wait on sidecar runtime events 2026-04-12 02:31:51 +05:00
Yera All adc7d4babb test(voice): wait on fallback turn completion 2026-04-12 02:21:25 +05:00
Yera All 41d4a5ea86 test(voice): harden streaming fallback scenario 2026-04-12 02:07:12 +05:00
Yera All 691899b969 test(voice): deflake streaming sidecar fallback wait 2026-04-12 01:59:19 +05:00
Yera All 9386b8f9b9 feat(voice): add streaming asr sidecar for v2 duplex 2026-04-12 01:38:30 +05:00
Yera All 9d0b76deca fix(voice): make fast ack more audible 2026-04-11 02:27:49 +05:00
Yera All 05dc31855d feat(voice): add controlled emotive ack layer 2026-04-11 02:14:53 +05:00
Yera All 6413beeba1 feat(voice): emit immediate ack on turn close 2026-04-11 01:40:04 +05:00
Yera All c39fad7e2d feat(voice): add phase 1.1 partial asr fast ack 2026-04-11 01:24:21 +05:00
Yera All 5374c202d9 Initial import with GitLab CI/CD and registry deploy flow 2026-04-02 17:05:45 +05:00