Skip to content

Evict revoked realtime credentials and recheck subscription eligibility - #4454

Open
404oops wants to merge 1 commit into
fix/realtime-upgrade-admissionfrom
fix/realtime-active-eligibility
Open

404oops wants to merge 1 commit into
fix/realtime-upgrade-admissionfrom
fix/realtime-active-eligibility

Conversation

@404oops

@404oops 404oops commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

Close only connections matching revoked session or full-access token identities and invalidate their auth cache state. Bridge the existing revocation events onto same-cluster pub/sub because raw WebSockets do not use the socket.io cluster adapter. Preserve periodic verification as the missed-event fallback.

Check paid eligibility independently of the authentication cache and after subscription invalidation. Repeated failed lookups get a retry grace. A failed check after the 60-second threshold closes with a retryable internal error instead of reporting invalid credentials. This threshold is not a wall-clock polling guarantee.

Validation: 96 relay tests pass at this layer. Tests revoke through actual auth APIs, exercise sibling-node Redis pub/sub, preserve unrelated sessions/tokens, detect downgrades with positive free credit and without another response, miss events deliberately, and simulate authentication/entitlement lookup outages.

Security: changes active credential and subscription enforcement. Already accepted billable work retains bounded settlement.

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 4/7, overall 10/13. Based on #4453 (fix/realtime-upgrade-admission). 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.08%
⬇️ -0.02 pp
40747 / 42853
🔵 Statements 93.25%
⬇️ -0.02 pp
44758 / 47997
🔵 Functions 92.78%
⬇️ -0.05 pp
7704 / 8303
🔵 Branches 84.71%
⬇️ -0.11 pp
31283 / 36926
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/backend/clients/event/types.ts 100%
🟰 ±0 pp
100%
🟰 ±0 pp
100%
🟰 ±0 pp
100%
🟰 ±0 pp
src/backend/services/realtime/OpenAIRealtimeRelayService.ts 90.27%
⬆️ +1.40 pp
82.27%
⬆️ +0.41 pp
94.64%
⬆️ +2.89 pp
93.34%
⬆️ +1.37 pp
232, 254, 337, 353, 490, 572, 606, 628-629, 631, 633-634, 651, 665, 671, 683, 856, 919-924, 929, 941, 978, 1013, 1049-1050, 1081, 1099-1100, 1136, 1139, 1209-1210, 1225, 1268, 1271-1273, 1314-1315, 1322, 1356, 1386, 1433, 1444, 1467-1468, 1489, 1497-1498, 1502-1506, 1509, 1521-1522, 1541, 1543, 1553, 1566-1567, 1575-1577, 1583-1585, 1611, 1619, 1651
Generated in workflow #3277 for commit 909d875 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-active-eligibility branch from 3ed75de to 909d875 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