feat(backend): integrate document deletion and grounded speech providers

Enable replay-safe document deletion and public deployment model identifiers with the forward voice-model schema revision.

Add GapGPT dialogue and ElevenLabs speech routing, strict extractive grounding, ten-source retrieval and regression coverage.

Validation: 199 targeted provider-free tests passed. The full provider-free run stalled and was interrupted; PostgreSQL acceptance was not run because TEST_DATABASE_URL is unset.
This commit is contained in:
amirhosein mazaheri
2026-10-20 09:00:37 +03:30
parent 2bffb9476a
commit 42400495af
27 changed files with 1003 additions and 28 deletions
+12
View File
@@ -188,3 +188,15 @@ def terminal_failure_reason(response):
if status == "incomplete":
return "PROVIDER_RESPONSE_INCOMPLETE"
return "PROVIDER_RESPONSE_UNEXPECTED_STATUS"
def provider_error_summary(session_id, error):
"""Only known signatures cross the diagnostic boundary, never provider messages."""
allowed = {'response_failed', 'conversation_already_has_active_response',
'invalid_request_error', 'response_cancel_not_active', 's2s_history_failed',
'server_error', 'rate_limit_exceeded', 'insufficient_quota',
'unknown_or_invalid_event', 'invalid_conversation_item'}
signature = {key: value if isinstance(value, str) and value in allowed else 'other'
for key in ('type', 'code') for value in (error.get(key),)}
logger.warning('Voice provider error session=%s type=%s code=%s',
session_id, signature['type'], signature['code'])