fix(voice): correct input accounting and session termination

Separate detected speech limits from continuous microphone silence while preserving transport bounds and absolute commit fencing.

Handle verified OpenAI cancellation races and terminal items, preserve causal close outcomes, and share bounded cleanup ownership with safe diagnostics.

Add regression coverage and align the API contract and frontend handoff. Validation: 61 focused unit tests passed; staged diff whitespace checks passed. Live browser acceptance remains outstanding.
This commit is contained in:
amirhosein mazaheri
2026-10-10 17:41:11 +03:30
parent b06eaf59f4
commit a769196bfa
23 changed files with 1809 additions and 92 deletions
+1
View File
@@ -22,6 +22,7 @@ class RuntimeSettings(BaseSettings):
max_queued_audio_seconds: float = Field(default=2, gt=0, le=2, allow_inf_nan=False)
max_queued_audio_bytes: int = Field(default=96000, gt=0, le=96000)
max_queued_audio_messages: int = Field(default=100, gt=0, le=100)
# Detected uncommitted speech bytes; excludes silence outside VAD intervals.
max_input_buffer_bytes: int = Field(default=480000, gt=0, le=480000)
max_output_backlog_bytes: int = Field(default=1440000, gt=0, le=1440000)
output_credit_window_bytes: int = Field(default=72000, ge=48, le=72000)