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
+35
View File
@@ -2065,3 +2065,38 @@ passed in the initial full run deselected. All 404 current database scenarios ha
passing executed evidence across these runs. Protected inputs/migrations and the
restored 55-case source remained byte-identical. Exact timings, reproduction,
intermediate failures, JUnit path and cleanup are in the scoped repair report.
## Browser voice termination repair (2026-10-10)
The [incident repair and frontend handoff](guides/voice-session-termination-repair.md)
records the confirmed OpenAI output-item normalization, terminal-close race and
manual-stop notification fixes, safe diagnostic fields, shared bounded shutdown
ownership, regression checks and deployment/browser acceptance steps. Source
locations: `app/modules/voice/diagnostics.py`, existing runtime/lifecycle/registry,
`app/infrastructure/realtime.py`, and `app/api/v1/live.py`. New regression sources:
`tests/unit/test_voice_session_incident.py` and
`tests/integration/test_voice_session_incident.py`. Historical incident attribution,
actual Angular cleanup and funded provider/browser acceptance remain unverified.
No applied migration or public error envelope changed. See the report for exact
completed checks; earlier checkpoints do not establish this repair's acceptance.
## OpenAI cancellation/context synchronization repair (2026-10-10)
The [scoped repair and acceptance report](guides/live-context-sync-repair.md)
records one explicitly authorized OpenAI probe (two short responses), the captured
gpt-realtime-mini/shimmer structured no-active cancellation error, its pre-fix
synthetic failure and the profile-restricted adapter correction. Terminal and
heard-position truncation barriers remain mandatory. Runtime diagnostics now
distinguish every synchronization failure branch with bounded numeric state.
Final checks: 1827 provider-free passed (three Windows symlink skips) and 11
isolated PostgreSQL incident tests passed (zero skips). Applied migrations,
public contracts, provider/model configuration and unrelated changes remain.
Historical incident attribution, corrected live application/browser acceptance
and deployment are unverified; the currently inspected API selected Gemini.
## Continuous microphone input accounting repair (2026-10-10)
The [scoped repair report](guides/voice-input-accounting-repair.md) supersedes the historical 10-second silence overflow requirement. API 7.1.3 now bounds detected uncommitted speech independently of queued/in-flight transport; absolute positions and commitment fencing remain. Fixed speech-stop and existing commit/send deadlines protect missing events. Stable overflow diagnostics distinguish input, output, playback and control branches. Verification: 1834 provider-free passed (three existing Windows symlink skips); final adapter/diagnostic follow-up 80 passed. No database behavior or migration changed; no deployment or paid provider calls. Real-provider/browser acceptance remains unverified. See the report for exact commands, intermediate failures, counter definitions and provider evidence.