feat(voice): support evidence reuse, 120s output capacity, and input ASR coalescing
- Add internal reuse_last_evidence tool for continuing existing topic without repeated retrieval - Expand OpenAI output capacity to 120s / 5,760,000 bytes and add delivery fairness - Coalesce adjacent user ASR transcript deltas to prevent client control queue overflow - Add server-side OPENAI_REALTIME_SPEED configuration and update style to v4 - Add extensive unit and integration regressions for evidence reuse, capacity, and fairness
This commit is contained in:
@@ -41,12 +41,19 @@ class DurableTools:
|
||||
if 'durable_id' not in call:
|
||||
return
|
||||
try:
|
||||
result = await blocking(self.lifecycle.tool_result, self.user, self.session_id, call['durable_id'], execution, allow_technical_failure=True)
|
||||
if result != call['result']:
|
||||
result = await blocking(self.lifecycle.tool_result, self.user, self.session_id, call['durable_id'], execution,
|
||||
allow_technical_failure=True, require_current_knowledge='reused_result' in call)
|
||||
if result != call.get('reused_result', call['result']):
|
||||
raise ValueError('LIVE_CONTEXT_SYNC_FAILED')
|
||||
except Exception as exc:
|
||||
raise DurableFailure(failure_code(exc)) from None
|
||||
|
||||
async def reuse(self, original, execution):
|
||||
# No admission/INSERT: this is the original real retrieval, revalidated.
|
||||
await blocking(self.lifecycle.validate_stream, self.user, self.session_id, execution)
|
||||
return await blocking(self.lifecycle.tool_result, self.user, self.session_id,
|
||||
original['durable_id'], execution, require_current_knowledge=True)
|
||||
|
||||
|
||||
def failure_code(exc):
|
||||
"""A persistence failure is terminal: no unverified result may continue.
|
||||
|
||||
Reference in New Issue
Block a user