@voxevolv/client 0.3.7 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/README.md +80 -21
- package/dist/browser/index.js +6 -6
- package/dist/browser/index.js.map +3 -3
- package/dist/browser/index.js.sha384 +1 -1
- package/dist/browser/manifest.json +1 -1
- package/dist/context-queue.d.ts +13 -1
- package/dist/context-queue.d.ts.map +1 -1
- package/dist/context-queue.js +66 -11
- package/dist/context-queue.js.map +1 -1
- package/dist/diagnostics.d.ts +30 -7
- package/dist/diagnostics.d.ts.map +1 -1
- package/dist/diagnostics.js +125 -39
- package/dist/diagnostics.js.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +151 -61
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,IAAI,EAIL,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAUL,KAAK,iBAAiB,EAEtB,KAAK,aAAa,EAElB,KAAK,qBAAqB,EAC1B,KAAK,QAAQ,EACb,KAAK,aAAa,EACnB,MAAM,eAAe,CAAC;AAEvB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,IAAI,EAIL,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAUL,KAAK,iBAAiB,EAEtB,KAAK,aAAa,EAElB,KAAK,qBAAqB,EAC1B,KAAK,QAAQ,EACb,KAAK,aAAa,EACnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAML,KAAK,mBAAmB,EACzB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAmB,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CA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AAO,CAAC,uBAAuB;IA4B/B,OAAO,CAAC,iBAAiB;IAyBzB,OAAO,CAAC,gBAAgB;IA0BxB,OAAO,CAAC,oBAAoB;IA+C5B,OAAO,CAAC,qBAAqB;IAmB7B,OAAO,CAAC,mBAAmB;YAuBb,WAAW;CAkE1B"}
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { ConnectionState as LiveKitConnectionState, DataPacket_Kind, DisconnectReason, Room, RoomEvent, RpcError, Track, } from "livekit-client";
|
|
2
2
|
import { createClientMessage, CommandError, EventCursor, isCommandAckPayload, isCommandErrorPayload, isContextRejectedPayload, isContextUpdatePayload, isContextUpdatedPayload, isRealtimeEvent, } from "./protocol.js";
|
|
3
|
-
import { ReplacementContextQueue } from "./context-queue.js";
|
|
4
|
-
import { ClientDiagnosticBuffer, } from "./diagnostics.js";
|
|
3
|
+
import { ContextDeliveryError, contextRetryDelay, ReplacementContextQueue } from "./context-queue.js";
|
|
4
|
+
import { ClientDiagnosticBuffer, DiagnosticDeliveryError, } from "./diagnostics.js";
|
|
5
5
|
import { TranscriptStore } from "./transcripts.js";
|
|
6
6
|
export { TranscriptStore } from "./transcripts.js";
|
|
7
7
|
export { CommandError, EventCursor, createClientMessage, isCommandAckPayload, isCommandErrorPayload, isContextRejectedPayload, isContextUpdatePayload, isContextUpdatedPayload, isRealtimeEvent, } from "./protocol.js";
|
|
8
8
|
export { decodeAgentSnapshotPayload, decodeClientHelloPayload, decodeClientMessage, decodeCommandAckPayload, decodeCommandErrorPayload, decodeContextRejectedPayload, decodeContextUpdatePayload, decodeContextUpdatedPayload, decodeRealtimeEvent, } from "./generated/protocol-codecs.js";
|
|
9
|
-
export const SDK_VERSION = "0.3.
|
|
9
|
+
export const SDK_VERSION = "0.3.8";
|
|
10
10
|
const CLIENT_HELLO_TIMEOUT_MS = 30_000;
|
|
11
11
|
const DIAGNOSTIC_REPORT_TIMEOUT_MS = 5_000;
|
|
12
12
|
const DEFAULT_STARTUP_ATTEMPTS = [
|
|
13
13
|
{ delayBeforeMs: 0, readyTimeoutMs: 15_000 },
|
|
14
14
|
{ delayBeforeMs: 1_000, readyTimeoutMs: 20_000 },
|
|
15
|
-
{ delayBeforeMs: 3_000, readyTimeoutMs:
|
|
15
|
+
{ delayBeforeMs: 3_000, readyTimeoutMs: 50_000 },
|
|
16
16
|
];
|
|
17
|
-
const DEFAULT_STARTUP_TIMEOUT_MS =
|
|
17
|
+
const DEFAULT_STARTUP_TIMEOUT_MS = 90_000;
|
|
18
18
|
export class RealtimeSessionHttpError extends Error {
|
|
19
19
|
status;
|
|
20
20
|
code;
|
|
@@ -110,6 +110,10 @@ export class RealtimeSession {
|
|
|
110
110
|
lifecycleCredentials;
|
|
111
111
|
diagnostics = new ClientDiagnosticBuffer({ sdkVersion: SDK_VERSION });
|
|
112
112
|
diagnosticReportTimeoutMs = DIAGNOSTIC_REPORT_TIMEOUT_MS;
|
|
113
|
+
onDiagnosticVisibilityChange = () => {
|
|
114
|
+
if (globalThis.document?.visibilityState === "hidden")
|
|
115
|
+
this.flushDiagnostics("page_hidden");
|
|
116
|
+
};
|
|
113
117
|
constructor(credentials, options = {}) {
|
|
114
118
|
validateSessionCredentials(credentials);
|
|
115
119
|
this.id = credentials.id;
|
|
@@ -369,10 +373,13 @@ export class RealtimeSession {
|
|
|
369
373
|
const startupOptions = this.startupRetryOptions;
|
|
370
374
|
if (!startupOptions)
|
|
371
375
|
return;
|
|
376
|
+
const startupStartedAt = performance.now();
|
|
372
377
|
const timeout = globalThis.setTimeout(() => {
|
|
373
378
|
controller.abort(new Error(`Session startup did not complete within ${startupOptions.timeoutMs}ms`));
|
|
374
379
|
}, startupOptions.timeoutMs);
|
|
375
380
|
let lastError = new Error("Session startup failed");
|
|
381
|
+
let startupRegistered = this.hasConnectedValue;
|
|
382
|
+
this.apiBase = normalizeApiBase(options.apiBase ?? this.connectDefaults.apiBase ?? this.apiBase);
|
|
376
383
|
try {
|
|
377
384
|
for (const [index, attempt] of startupOptions.attempts.entries()) {
|
|
378
385
|
const attemptNumber = index + 1;
|
|
@@ -385,6 +392,11 @@ export class RealtimeSession {
|
|
|
385
392
|
this.startupAttemptController = attemptController;
|
|
386
393
|
this.notifyStartupAttempt("started", attemptNumber, attempt.readyTimeoutMs);
|
|
387
394
|
try {
|
|
395
|
+
if (!startupRegistered) {
|
|
396
|
+
const remainingMs = startupOptions.timeoutMs - (performance.now() - startupStartedAt);
|
|
397
|
+
await this.registerStartupRecovery(remainingMs, attemptController.signal);
|
|
398
|
+
startupRegistered = true;
|
|
399
|
+
}
|
|
388
400
|
if (index === 0) {
|
|
389
401
|
await this.connectWithMode({ ...options, readyTimeoutMs: attempt.readyTimeoutMs }, false, attemptController.signal, false);
|
|
390
402
|
}
|
|
@@ -422,6 +434,38 @@ export class RealtimeSession {
|
|
|
422
434
|
globalThis.clearTimeout(timeout);
|
|
423
435
|
}
|
|
424
436
|
}
|
|
437
|
+
async registerStartupRecovery(timeoutMs, signal) {
|
|
438
|
+
const reserveMs = Math.min(5_000, timeoutMs / 10);
|
|
439
|
+
const controller = createLinkedAbortController(signal);
|
|
440
|
+
const requestTimeout = globalThis.setTimeout(() => {
|
|
441
|
+
controller.abort(new Error("Startup registration timed out"));
|
|
442
|
+
}, Math.max(1, Math.min(3_000, reserveMs)));
|
|
443
|
+
try {
|
|
444
|
+
// Leave room for registration latency and final readiness before the
|
|
445
|
+
// browser's existing overall deadline. Rejoins never renew this window.
|
|
446
|
+
const send = () => raceWithAbort(this.fetcher(`${this.apiBase}/sessions/${this.id}/startup`, {
|
|
447
|
+
method: "POST",
|
|
448
|
+
headers: { Authorization: `Bearer ${this.accessToken}`, "Content-Type": "application/json" },
|
|
449
|
+
credentials: this.lifecycleCredentials,
|
|
450
|
+
body: JSON.stringify({ timeout_ms: Math.max(1, Math.floor(Math.min(timeoutMs - reserveMs, 85_000))) }),
|
|
451
|
+
signal: controller.signal,
|
|
452
|
+
}), controller.signal);
|
|
453
|
+
let response = await send();
|
|
454
|
+
if (response.status === 401 && this.refreshCredentialsCallback) {
|
|
455
|
+
await raceWithAbort(this.refreshCredentials(), controller.signal);
|
|
456
|
+
response = await send();
|
|
457
|
+
}
|
|
458
|
+
if (!response.ok)
|
|
459
|
+
throw await httpError(response, "Could not register session startup");
|
|
460
|
+
const body = await raceWithAbort(response.json(), controller.signal);
|
|
461
|
+
if (typeof body.remaining_ms !== "number" || body.remaining_ms <= 0) {
|
|
462
|
+
throw new Error("Session startup window has expired");
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
finally {
|
|
466
|
+
globalThis.clearTimeout(requestTimeout);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
425
469
|
notifyStartupAttempt(status, attempt, readyTimeoutMs, error) {
|
|
426
470
|
const maxAttempts = this.startupRetryOptions?.attempts.length ?? 1;
|
|
427
471
|
this.notifyListeners(this.startupAttemptListeners, {
|
|
@@ -489,7 +533,7 @@ export class RealtimeSession {
|
|
|
489
533
|
if (this.sessionEnded || generation !== this.contextGeneration) {
|
|
490
534
|
throw new Error("Connection restoration interrupted");
|
|
491
535
|
}
|
|
492
|
-
|
|
536
|
+
this.resumeContextDelivery(recovering);
|
|
493
537
|
throwIfAborted(signal);
|
|
494
538
|
if (this.sessionEnded || generation !== this.contextGeneration) {
|
|
495
539
|
throw new Error("Connection restoration interrupted");
|
|
@@ -665,11 +709,15 @@ export class RealtimeSession {
|
|
|
665
709
|
context_key: update.key,
|
|
666
710
|
payload_bytes: payloadBytes,
|
|
667
711
|
});
|
|
712
|
+
const uploading = "image" in update ? this.uploadImageContext(update) : this.uploadTextContext(update);
|
|
713
|
+
const transferSettled = uploading.then(() => { }, () => { });
|
|
668
714
|
let transferTimeout;
|
|
669
715
|
const transferExpired = new Promise((_resolve, reject) => {
|
|
670
716
|
transferTimeout = globalThis.setTimeout(() => {
|
|
671
717
|
transferTimedOut = true;
|
|
672
|
-
const error = new
|
|
718
|
+
const error = new ContextDeliveryError(`Context transfer timed out after ${timeoutMs}ms`, {
|
|
719
|
+
retryAfter: transferSettled,
|
|
720
|
+
});
|
|
673
721
|
this.recordDiagnostic({
|
|
674
722
|
operation: "context_transfer",
|
|
675
723
|
status: "timed_out",
|
|
@@ -680,19 +728,13 @@ export class RealtimeSession {
|
|
|
680
728
|
timeout_ms: timeoutMs,
|
|
681
729
|
});
|
|
682
730
|
this.flushDiagnostics("context_transfer_timeout");
|
|
683
|
-
this.startAutoRejoin(error, {
|
|
684
|
-
trigger: "context_transfer_timeout",
|
|
685
|
-
operation: "context_transfer",
|
|
686
|
-
contextKey: update.key,
|
|
687
|
-
timeoutMs,
|
|
688
|
-
});
|
|
689
731
|
reject(error);
|
|
690
732
|
}, timeoutMs);
|
|
691
733
|
});
|
|
692
734
|
let transfer;
|
|
693
735
|
try {
|
|
694
736
|
transfer = await Promise.race([
|
|
695
|
-
|
|
737
|
+
uploading,
|
|
696
738
|
transferExpired,
|
|
697
739
|
]);
|
|
698
740
|
}
|
|
@@ -708,7 +750,9 @@ export class RealtimeSession {
|
|
|
708
750
|
});
|
|
709
751
|
this.flushDiagnostics("command_failed");
|
|
710
752
|
}
|
|
711
|
-
|
|
753
|
+
if (error instanceof TypeError || error instanceof ContextDeliveryError)
|
|
754
|
+
throw error;
|
|
755
|
+
throw new ContextDeliveryError(toError(error).message, { cause: error });
|
|
712
756
|
}
|
|
713
757
|
finally {
|
|
714
758
|
globalThis.clearTimeout(transferTimeout);
|
|
@@ -732,6 +776,11 @@ export class RealtimeSession {
|
|
|
732
776
|
const message = createClientMessage(this.connectionId, ++this.clientSeq, "context.update", { ...payload });
|
|
733
777
|
return this.sendTrackedCommand(message, timeoutMs, transfer.resend);
|
|
734
778
|
}
|
|
779
|
+
resumeContextDelivery(restore) {
|
|
780
|
+
// Audio readiness owns connection recovery. Context delivery has its own
|
|
781
|
+
// deadlines and retries, and may be interrupted by a later disconnect.
|
|
782
|
+
void this.replacementContext.resume(restore).catch(() => { });
|
|
783
|
+
}
|
|
735
784
|
async uploadTextContext(update) {
|
|
736
785
|
const data = new TextEncoder().encode(update.text);
|
|
737
786
|
if (data.byteLength === 0)
|
|
@@ -878,6 +927,17 @@ export class RealtimeSession {
|
|
|
878
927
|
if (this.stateValue === state)
|
|
879
928
|
return;
|
|
880
929
|
this.stateValue = state;
|
|
930
|
+
if (state === "connecting" || state === "resuming") {
|
|
931
|
+
globalThis.document?.addEventListener?.("visibilitychange", this.onDiagnosticVisibilityChange);
|
|
932
|
+
}
|
|
933
|
+
if (state === "disconnected" || state === "failed") {
|
|
934
|
+
globalThis.document?.removeEventListener?.("visibilitychange", this.onDiagnosticVisibilityChange);
|
|
935
|
+
this.flushDiagnostics("session_finished");
|
|
936
|
+
const error = new Error(`Session ${state}`);
|
|
937
|
+
this.contextGeneration += 1;
|
|
938
|
+
this.replacementContext.clear(error);
|
|
939
|
+
this.rejectPendingCommands(error);
|
|
940
|
+
}
|
|
881
941
|
this.notifyListeners(this.stateListeners, state);
|
|
882
942
|
}
|
|
883
943
|
bindRoomEvents() {
|
|
@@ -1032,7 +1092,7 @@ export class RealtimeSession {
|
|
|
1032
1092
|
await this.waitForRemoteAudioTrack(deadline);
|
|
1033
1093
|
if (this.sessionEnded || generation !== this.contextGeneration)
|
|
1034
1094
|
return;
|
|
1035
|
-
|
|
1095
|
+
this.resumeContextDelivery(true);
|
|
1036
1096
|
if (this.sessionEnded || generation !== this.contextGeneration)
|
|
1037
1097
|
return;
|
|
1038
1098
|
this.setState("connected");
|
|
@@ -1456,10 +1516,13 @@ export class RealtimeSession {
|
|
|
1456
1516
|
const timeout = globalThis.setTimeout(() => {
|
|
1457
1517
|
const pending = this.pendingCommands.get(message.message_id);
|
|
1458
1518
|
if (pending)
|
|
1459
|
-
globalThis.
|
|
1519
|
+
globalThis.clearTimeout(pending.retry);
|
|
1460
1520
|
pending?.markSettled();
|
|
1461
1521
|
this.pendingCommands.delete(message.message_id);
|
|
1462
|
-
const
|
|
1522
|
+
const detail = `Command ${message.type} timed out after ${timeoutMs}ms`;
|
|
1523
|
+
const error = message.type === "context.update"
|
|
1524
|
+
? new ContextDeliveryError(detail, { retryAfter: pending?.transferSettled })
|
|
1525
|
+
: new Error(detail);
|
|
1463
1526
|
this.recordDiagnostic({
|
|
1464
1527
|
operation: "command_send",
|
|
1465
1528
|
status: "timed_out",
|
|
@@ -1478,21 +1541,7 @@ export class RealtimeSession {
|
|
|
1478
1541
|
});
|
|
1479
1542
|
this.flushDiagnostics("command_timeout");
|
|
1480
1543
|
reject(error);
|
|
1481
|
-
if (message.type === "context.update") {
|
|
1482
|
-
this.startAutoRejoin(error, {
|
|
1483
|
-
trigger: "context_command_timeout",
|
|
1484
|
-
operation: "command_send",
|
|
1485
|
-
messageId: message.message_id,
|
|
1486
|
-
contextKey: contextKeyFromMessage(message),
|
|
1487
|
-
timeoutMs,
|
|
1488
|
-
});
|
|
1489
|
-
}
|
|
1490
1544
|
}, timeoutMs);
|
|
1491
|
-
const retry = globalThis.setInterval(() => {
|
|
1492
|
-
void this.publishCommandAttempt(message, true).catch(() => {
|
|
1493
|
-
// A reconnect may temporarily reject writes; retry until timeout.
|
|
1494
|
-
});
|
|
1495
|
-
}, 500);
|
|
1496
1545
|
this.pendingCommands.set(message.message_id, {
|
|
1497
1546
|
commandType: message.type,
|
|
1498
1547
|
message,
|
|
@@ -1504,25 +1553,58 @@ export class RealtimeSession {
|
|
|
1504
1553
|
resolve,
|
|
1505
1554
|
reject,
|
|
1506
1555
|
timeout,
|
|
1507
|
-
retry,
|
|
1508
1556
|
settled,
|
|
1509
1557
|
markSettled,
|
|
1510
|
-
retryTransfer
|
|
1511
|
-
? async () => {
|
|
1512
|
-
await retryTransfer();
|
|
1513
|
-
await this.publishCommandAttempt(message, true);
|
|
1514
|
-
}
|
|
1515
|
-
: undefined,
|
|
1558
|
+
retryTransfer,
|
|
1516
1559
|
transferRetrying: false,
|
|
1560
|
+
transferRetryRequested: false,
|
|
1517
1561
|
});
|
|
1562
|
+
this.scheduleCommandRetry(message);
|
|
1518
1563
|
});
|
|
1519
1564
|
void this.publishCommandAttempt(message, false).catch(() => {
|
|
1520
1565
|
// The reliable data channel may still be warming immediately after a
|
|
1521
|
-
// reconnect. Keep the command pending so the retry
|
|
1566
|
+
// reconnect. Keep the command pending so the retry timer can publish
|
|
1522
1567
|
// it once the transport accepts writes, or reject at the normal timeout.
|
|
1523
1568
|
});
|
|
1524
1569
|
return response;
|
|
1525
1570
|
}
|
|
1571
|
+
scheduleCommandRetry(message) {
|
|
1572
|
+
const pending = this.pendingCommands.get(message.message_id);
|
|
1573
|
+
if (!pending)
|
|
1574
|
+
return;
|
|
1575
|
+
const delayMs = message.type === "context.update"
|
|
1576
|
+
? contextRetryDelay(pending.retryCount + 1)
|
|
1577
|
+
: 500;
|
|
1578
|
+
pending.retry = globalThis.setTimeout(() => {
|
|
1579
|
+
void this.retryCommand(message).finally(() => this.scheduleCommandRetry(message));
|
|
1580
|
+
}, delayMs);
|
|
1581
|
+
}
|
|
1582
|
+
async retryCommand(message) {
|
|
1583
|
+
const pending = this.pendingCommands.get(message.message_id);
|
|
1584
|
+
if (!pending)
|
|
1585
|
+
return;
|
|
1586
|
+
if (message.type === "context.update" && (this.sessionEnded || ["reconnecting", "resuming", "disconnected", "failed"].includes(this.stateValue)))
|
|
1587
|
+
return;
|
|
1588
|
+
try {
|
|
1589
|
+
if (pending.transferRetryRequested && pending.retryTransfer) {
|
|
1590
|
+
pending.transferRetryRequested = false;
|
|
1591
|
+
pending.transferRetrying = true;
|
|
1592
|
+
const transfer = pending.retryTransfer();
|
|
1593
|
+
pending.transferSettled = transfer.then(() => { }, () => { });
|
|
1594
|
+
if (pending.contextKey) {
|
|
1595
|
+
this.replacementContext.blockUntilTransferSettles(pending.contextKey, pending.transferSettled);
|
|
1596
|
+
}
|
|
1597
|
+
await Promise.race([transfer, pending.settled]);
|
|
1598
|
+
}
|
|
1599
|
+
await this.publishCommandAttempt(message, true);
|
|
1600
|
+
}
|
|
1601
|
+
catch {
|
|
1602
|
+
// Failed writes retain their original deadline and retry with backoff.
|
|
1603
|
+
}
|
|
1604
|
+
finally {
|
|
1605
|
+
pending.transferRetrying = false;
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1526
1608
|
publishCommandAttempt(message, retrying) {
|
|
1527
1609
|
const pending = this.pendingCommands.get(message.message_id);
|
|
1528
1610
|
if (!pending || pending.publishQueued)
|
|
@@ -1632,8 +1714,8 @@ export class RealtimeSession {
|
|
|
1632
1714
|
}, this.diagnosticReportTimeoutMs);
|
|
1633
1715
|
});
|
|
1634
1716
|
try {
|
|
1635
|
-
const
|
|
1636
|
-
this.fetcher(`${this.apiBase}/sessions/${this.id}/diagnostics`, {
|
|
1717
|
+
const upload = async () => {
|
|
1718
|
+
const response = await this.fetcher(`${this.apiBase}/sessions/${this.id}/diagnostics`, {
|
|
1637
1719
|
method: "POST",
|
|
1638
1720
|
headers: {
|
|
1639
1721
|
Authorization: `Bearer ${this.accessToken}`,
|
|
@@ -1642,11 +1724,22 @@ export class RealtimeSession {
|
|
|
1642
1724
|
credentials: this.lifecycleCredentials,
|
|
1643
1725
|
body: JSON.stringify(report),
|
|
1644
1726
|
signal: controller.signal,
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1727
|
+
keepalive: true,
|
|
1728
|
+
});
|
|
1729
|
+
const body = await response.json().catch(() => null);
|
|
1730
|
+
if (!response.ok) {
|
|
1731
|
+
const retryable = response.status === 408 || response.status === 429 || response.status >= 500;
|
|
1732
|
+
const headerDelay = Number(response.headers.get("Retry-After")) * 1000;
|
|
1733
|
+
const retryAfterMs = typeof body?.retry_after_ms === "number"
|
|
1734
|
+
? body.retry_after_ms : headerDelay;
|
|
1735
|
+
throw new DiagnosticDeliveryError(`Diagnostic report failed (${response.status})`, retryable, Number.isFinite(retryAfterMs) ? Math.max(retryAfterMs, 0) : 0);
|
|
1736
|
+
}
|
|
1737
|
+
if (body?.report_id !== report.report_id) {
|
|
1738
|
+
throw new DiagnosticDeliveryError("Diagnostic report was not acknowledged");
|
|
1739
|
+
}
|
|
1740
|
+
};
|
|
1741
|
+
// The receipt body is part of the timeout too, not just the response headers.
|
|
1742
|
+
await Promise.race([upload(), timeoutExpired]);
|
|
1650
1743
|
}
|
|
1651
1744
|
finally {
|
|
1652
1745
|
if (timeout !== undefined)
|
|
@@ -1723,8 +1816,8 @@ export class RealtimeSession {
|
|
|
1723
1816
|
this.agentDisconnected = false;
|
|
1724
1817
|
const wasReady = this.agentReady;
|
|
1725
1818
|
this.agentReady = true;
|
|
1726
|
-
// connect/reconnect owns the transition after hello
|
|
1727
|
-
// restoration
|
|
1819
|
+
// connect/reconnect owns the transition after hello and audio are ready.
|
|
1820
|
+
// Context restoration proceeds independently in the background.
|
|
1728
1821
|
this.readyResolve?.();
|
|
1729
1822
|
if (!wasReady)
|
|
1730
1823
|
this.notifyListeners(this.readyListeners, event);
|
|
@@ -1741,7 +1834,7 @@ export class RealtimeSession {
|
|
|
1741
1834
|
if (event.type === "command.ack" && isCommandAckPayload(event.payload)) {
|
|
1742
1835
|
this.recordCommandResult(pending, event.type, "acknowledged");
|
|
1743
1836
|
globalThis.clearTimeout(pending.timeout);
|
|
1744
|
-
globalThis.
|
|
1837
|
+
globalThis.clearTimeout(pending.retry);
|
|
1745
1838
|
pending.markSettled();
|
|
1746
1839
|
this.pendingCommands.delete(event.payload.message_id);
|
|
1747
1840
|
pending.resolve(event.payload);
|
|
@@ -1750,7 +1843,7 @@ export class RealtimeSession {
|
|
|
1750
1843
|
if (event.type === "context.updated" && isContextUpdatedPayload(event.payload)) {
|
|
1751
1844
|
this.recordCommandResult(pending, event.type, "acknowledged");
|
|
1752
1845
|
globalThis.clearTimeout(pending.timeout);
|
|
1753
|
-
globalThis.
|
|
1846
|
+
globalThis.clearTimeout(pending.retry);
|
|
1754
1847
|
pending.markSettled();
|
|
1755
1848
|
this.pendingCommands.delete(event.payload.message_id);
|
|
1756
1849
|
pending.resolve(event.payload);
|
|
@@ -1761,18 +1854,13 @@ export class RealtimeSession {
|
|
|
1761
1854
|
this.recordCommandResult(pending, event.type, "rejected", event.payload.code);
|
|
1762
1855
|
this.flushDiagnostics("command_rejected");
|
|
1763
1856
|
if (event.type === "context.rejected" && event.payload.retryable) {
|
|
1764
|
-
if (pending.retryTransfer && !pending.transferRetrying) {
|
|
1765
|
-
pending.
|
|
1766
|
-
void pending.retryTransfer()
|
|
1767
|
-
.catch(() => {
|
|
1768
|
-
// The command timeout remains authoritative while reconnecting.
|
|
1769
|
-
})
|
|
1770
|
-
.finally(() => { pending.transferRetrying = false; });
|
|
1857
|
+
if (event.payload.code === "stream_unavailable" && pending.retryTransfer && !pending.transferRetrying) {
|
|
1858
|
+
pending.transferRetryRequested = true;
|
|
1771
1859
|
}
|
|
1772
1860
|
return;
|
|
1773
1861
|
}
|
|
1774
1862
|
globalThis.clearTimeout(pending.timeout);
|
|
1775
|
-
globalThis.
|
|
1863
|
+
globalThis.clearTimeout(pending.retry);
|
|
1776
1864
|
pending.markSettled();
|
|
1777
1865
|
this.pendingCommands.delete(event.payload.message_id);
|
|
1778
1866
|
pending.reject(new CommandError(event.payload));
|
|
@@ -1784,9 +1872,11 @@ export class RealtimeSession {
|
|
|
1784
1872
|
continue;
|
|
1785
1873
|
this.recordCommandResult(pending, pending.commandType === "context.update" ? "context.rejected" : "command.error", "failed", "pending_command_cancelled");
|
|
1786
1874
|
globalThis.clearTimeout(pending.timeout);
|
|
1787
|
-
globalThis.
|
|
1875
|
+
globalThis.clearTimeout(pending.retry);
|
|
1788
1876
|
pending.markSettled();
|
|
1789
|
-
pending.reject(
|
|
1877
|
+
pending.reject(pending.commandType === "context.update"
|
|
1878
|
+
? new ContextDeliveryError(error.message, { cause: error, retryAfter: pending.transferSettled })
|
|
1879
|
+
: error);
|
|
1790
1880
|
this.pendingCommands.delete(messageId);
|
|
1791
1881
|
}
|
|
1792
1882
|
}
|