Skip to content

Reuse settled-credit state after recording realtime usage - #4456

Open
404oops wants to merge 1 commit into
fix/realtime-transcription-settlementfrom
fix/realtime-record-continuation
Open

404oops wants to merge 1 commit into
fix/realtime-transcription-settlementfrom
fix/realtime-record-continuation

Conversation

@404oops

@404oops 404oops commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

Use the populated settled-credit predicate for post-record continuation. Positive fractional settled credit keeps the conversation open even while its own response hold is unreleased. New work still requires atomic admission including all outstanding holds. A failed/zero-result metering write does not turn a stale cached predicate into a fresh continuation decision.

Validation: regression tests cover a half-micro-cent remaining balance, exhausted-account closure and exact response-hold release. Existing atomic admission, stale/cold cache, provisional-plan and metering failure tests are retained. In the measured warm case, cached continuation made zero Redis hold-sum, KV-get and SQL-read calls; the headroom comparison made one Redis hold-sum call and zero KV/SQL reads. No fixed database-read count is assumed.

Final combined validation at 7adeb371e177a9532bac5d78a3f83318d1af4757: 625 backend tests, 122 SDK conversation/history/transport tests, 10 built-SDK mock-provider tests and 3 cross-platform API checks passed. Backend build, SDK declaration checks and lint passed; repository typecheck reports no new errors with 23 known baseline errors. No paid/live provider traffic or production rollout test was run.

Stack: follow-up 6/7, overall 12/13. Based on #4455 (fix/realtime-transcription-settlement). Review and merge bottom-up. The existing six-PR stack ends at #4441.

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 95.07%
⬇️ -0.03 pp
40849 / 42966
🔵 Statements 93.24%
⬇️ -0.03 pp
44864 / 48116
🔵 Functions 92.78%
⬇️ -0.05 pp
7712 / 8312
🔵 Branches 84.72%
⬇️ -0.10 pp
31356 / 37008
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/backend/services/realtime/OpenAIRealtimeRelayService.ts 90%
⬆️ +1.13 pp
83.04%
⬆️ +1.18 pp
94.21%
⬆️ +2.46 pp
92.9%
⬆️ +0.93 pp
241, 263, 353, 364, 477, 512, 594, 628, 650-651, 653, 655-656, 673, 687, 693, 705, 904, 906, 976-989, 995, 1007, 1044, 1082, 1118-1119, 1150, 1168-1169, 1205, 1208, 1278-1279, 1294, 1375, 1393, 1485-1486, 1493, 1519, 1562-1563, 1586-1591, 1595, 1602-1606, 1643, 1670, 1717, 1728, 1751-1752, 1773, 1781-1782, 1786-1790, 1793, 1805-1806, 1824, 1831, 1844-1845, 1853-1855, 1861-1863, 1889, 1906-1917, 1922, 1962
Generated in workflow #3280 for commit e11fd03 by the Vitest Coverage Report Action

@404oops
404oops added this pull request to stack #4442 November 1, 2026 18:24
@404oops
404oops force-pushed the fix/realtime-record-continuation branch from 08cd9be to e11fd03 Compare November 1, 2026 18:26
@404oops 404oops closed this Nov 1, 2026
@404oops 404oops reopened this Nov 1, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant