forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFC-concurrent-ptt-stream-budget-overspend.json
More file actions
16 lines (16 loc) · 1.11 KB
/
Copy pathFC-concurrent-ptt-stream-budget-overspend.json
File metadata and controls
16 lines (16 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"schema_version": 1,
"id": "FC-concurrent-ptt-stream-budget-overspend",
"violated_contract": "Concurrent /v2/voice-message/transcribe-stream sessions for the same uid must not each admit against the same remaining daily STT duration slice. Probe-only check_budget at connect plus force-record at end lets N sessions freeze identical remaining_ms and overspend the shared voice_duration budget after the fact.",
"canonical_prevention": "Atomically reserve up to MAX_SESSION_DURATION_S at WS connect via try_reserve_session_budget (Lua force=2 consume-up-to). Cap mid-session audio to the reserved amount. On successful drain, settle_reserved_duration(reserved, actual); on terminal provider failure, refund the full reservation. Pin with fakeredis Lua tests that show probe+force overspend and reserve-up-to mutual exclusion.",
"canonical_prevention_artifact": [
"backend/tests/unit/test_voice_duration_limiter.py",
"backend/tests/unit/test_desktop_transcribe.py"
],
"evidence_prs": [],
"scope_hints": [
"backend/routers/chat.py",
"backend/utils/voice_duration_limiter.py"
],
"status": "open"
}