feat(voice): add isolated Local S2S v3 candidate and acceptance evidence
Extract the provider boundary while retaining OpenAI/Gemini contracts. Add an opt-in isolated Local S2S adapter, pinned engine extension, bounded component gateway and frozen effective configuration profiles. Enforce request token limits, zero retries, local asset validation, connection deadlines, disconnect ownership, bounded cleanup and signals. Include regression coverage, pinned source fixtures, operator guidance, asset fingerprints and guarded disposable PostgreSQL acceptance tooling. Preserve immutable fixture bytes across Git line-ending conversion. Validation recorded in the reports: - 74 repair, 107 combined and 242 preservation checks passed. - Fresh PostgreSQL local checks: 2 passed. - Expanded PostgreSQL: 57 passed, 6 documented baseline failures. - Compose configurations, staged whitespace and fixture hashes passed. Phase 1 live listening and Phase 2 complete engine/SDK/POSIX, real component audio and Persian browser acceptance remain pending. No operational switch, paid call, model download or Phase 3 implementation is included.
This commit is contained in:
@@ -15,7 +15,8 @@ from uuid import uuid4
|
||||
from app.modules.knowledge.service import SearchInput
|
||||
from app.modules.voice.settings import RuntimeSettings
|
||||
from app.modules.voice.serialization import bounded_json
|
||||
from app.infrastructure.realtime import POLICY, strict_json, ProviderProtocolError
|
||||
from app.infrastructure.realtime import POLICY
|
||||
from app.modules.voice.provider import strict_json, ProviderProtocolError
|
||||
|
||||
class GeminiContextError(ProviderProtocolError):
|
||||
context_sync = True
|
||||
@@ -102,6 +103,21 @@ class GeminiLiveAdapter:
|
||||
self._sent_samples = 0
|
||||
self._resampler = PCM24To16()
|
||||
|
||||
def cancellation_request(self, response_id, operation_id=None):
|
||||
event = dict(type="response.cancel", response_id=response_id)
|
||||
if operation_id is not None:
|
||||
event["event_id"] = operation_id
|
||||
return event
|
||||
|
||||
def history_repair_request(self, repair):
|
||||
# Preserve the existing send-path failure and its bounded cleanup.
|
||||
return dict(type="conversation.item.truncate", event_id=repair.operation_id,
|
||||
item_id=repair.item_id, content_index=repair.content_index,
|
||||
audio_end_ms=repair.played_ms)
|
||||
|
||||
def confirm_history_repair(self, repair, event):
|
||||
raise GeminiContextError('Gemini context cannot be safely truncated')
|
||||
|
||||
def setup(self):
|
||||
return dict(type='session.update', session={'provider':'gemini'})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user