@kortix/sdk 0.14.1 → 0.14.2
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/README.md +6 -3
- package/dist/core/attachments/prompt-attachments.d.ts.map +1 -1
- package/dist/core/attachments/prompt-attachments.js +104 -86
- package/dist/core/attachments/prompt-attachments.js.map +1 -1
- package/dist/core/client/kortix.d.ts +12 -1
- package/dist/core/client/kortix.d.ts.map +1 -1
- package/dist/core/client/project-operations-admin.d.ts +15 -1
- package/dist/core/client/project-operations-admin.d.ts.map +1 -1
- package/dist/core/client/project-operations-admin.js +7 -1
- package/dist/core/client/project-operations-admin.js.map +1 -1
- package/dist/core/client/project-operations.d.ts +12 -1
- package/dist/core/client/project-operations.d.ts.map +1 -1
- package/dist/core/files/client.d.ts.map +1 -1
- package/dist/core/files/client.js +26 -33
- package/dist/core/files/client.js.map +1 -1
- package/dist/core/http/transport.d.ts +7 -1
- package/dist/core/http/transport.d.ts.map +1 -1
- package/dist/core/http/transport.js +8 -11
- package/dist/core/http/transport.js.map +1 -1
- package/dist/core/rest/platform-client/capture.d.ts +5 -0
- package/dist/core/rest/platform-client/capture.d.ts.map +1 -1
- package/dist/core/rest/platform-client/capture.js.map +1 -1
- package/dist/core/rest/platform-client/host-boundary.d.ts +2 -0
- package/dist/core/rest/platform-client/host-boundary.d.ts.map +1 -1
- package/dist/core/rest/platform-client/host-boundary.js.map +1 -1
- package/dist/core/rest/projects-client/access.d.ts +31 -0
- package/dist/core/rest/projects-client/access.d.ts.map +1 -1
- package/dist/core/rest/projects-client/access.js.map +1 -1
- package/dist/core/rest/projects-client/git-backend.d.ts +4 -0
- package/dist/core/rest/projects-client/git-backend.d.ts.map +1 -1
- package/dist/core/rest/projects-client/git-backend.js.map +1 -1
- package/dist/core/rest/projects-client/projects.d.ts +39 -0
- package/dist/core/rest/projects-client/projects.d.ts.map +1 -1
- package/dist/core/rest/projects-client/projects.js +44 -2
- package/dist/core/rest/projects-client/projects.js.map +1 -1
- package/dist/core/rest/projects-client/sessions.d.ts +16 -5
- package/dist/core/rest/projects-client/sessions.d.ts.map +1 -1
- package/dist/core/rest/projects-client/sessions.js +5 -1
- package/dist/core/rest/projects-client/sessions.js.map +1 -1
- package/dist/core/rest/projects-client/tokens.d.ts +8 -2
- package/dist/core/rest/projects-client/tokens.d.ts.map +1 -1
- package/dist/core/rest/projects-client/tokens.js +12 -4
- package/dist/core/rest/projects-client/tokens.js.map +1 -1
- package/dist/core/rest/projects-client/triggers.d.ts +112 -3
- package/dist/core/rest/projects-client/triggers.d.ts.map +1 -1
- package/dist/core/rest/projects-client/triggers.js +35 -2
- package/dist/core/rest/projects-client/triggers.js.map +1 -1
- package/dist/core/session-log/turns/turn.d.ts +17 -0
- package/dist/core/session-log/turns/turn.d.ts.map +1 -1
- package/dist/core/session-log/turns/turn.js +35 -2
- package/dist/core/session-log/turns/turn.js.map +1 -1
- package/dist/core/session-sync/saved-copy-index.d.ts +50 -0
- package/dist/core/session-sync/saved-copy-index.d.ts.map +1 -0
- package/dist/core/session-sync/saved-copy-index.js +103 -0
- package/dist/core/session-sync/saved-copy-index.js.map +1 -0
- package/dist/core/session-sync/saved-copy-store.d.ts.map +1 -1
- package/dist/core/session-sync/saved-copy-store.js +3 -84
- package/dist/core/session-sync/saved-copy-store.js.map +1 -1
- package/dist/core/session-sync/session-sync-controller.d.ts +4 -5
- package/dist/core/session-sync/session-sync-controller.d.ts.map +1 -1
- package/dist/core/session-sync/session-sync-controller.js +5 -5
- package/dist/core/session-sync/session-sync-controller.js.map +1 -1
- package/dist/core/stream/event-attempt.d.ts +76 -0
- package/dist/core/stream/event-attempt.d.ts.map +1 -0
- package/dist/core/stream/event-attempt.js +451 -0
- package/dist/core/stream/event-attempt.js.map +1 -0
- package/dist/core/stream/event-stream.d.ts +8 -0
- package/dist/core/stream/event-stream.d.ts.map +1 -1
- package/dist/core/stream/event-stream.js +38 -404
- package/dist/core/stream/event-stream.js.map +1 -1
- package/dist/core/turns/display-order.d.ts +125 -0
- package/dist/core/turns/display-order.d.ts.map +1 -0
- package/dist/core/turns/display-order.js +134 -0
- package/dist/core/turns/display-order.js.map +1 -0
- package/dist/core/turns/grouping.d.ts +0 -49
- package/dist/core/turns/grouping.d.ts.map +1 -1
- package/dist/core/turns/grouping.js +4 -126
- package/dist/core/turns/grouping.js.map +1 -1
- package/dist/core/turns/index.d.ts +1 -0
- package/dist/core/turns/index.d.ts.map +1 -1
- package/dist/core/turns/index.js +1 -0
- package/dist/core/turns/index.js.map +1 -1
- package/dist/core/turns/parts.d.ts +9 -1
- package/dist/core/turns/parts.d.ts.map +1 -1
- package/dist/core/turns/parts.js +140 -176
- package/dist/core/turns/parts.js.map +1 -1
- package/dist/core/turns/state.d.ts +0 -7
- package/dist/core/turns/state.d.ts.map +1 -1
- package/dist/core/turns/state.js +45 -31
- package/dist/core/turns/state.js.map +1 -1
- package/dist/core/turns/text-scan.d.ts +0 -2
- package/dist/core/turns/text-scan.d.ts.map +1 -1
- package/dist/core/turns/text-scan.js +0 -4
- package/dist/core/turns/text-scan.js.map +1 -1
- package/dist/core/turns/tools/tool-meta.d.ts.map +1 -1
- package/dist/core/turns/tools/tool-meta.js +4 -4
- package/dist/core/turns/tools/tool-meta.js.map +1 -1
- package/dist/core/turns/tools/tool-outcome.d.ts.map +1 -1
- package/dist/core/turns/tools/tool-outcome.js +7 -29
- package/dist/core/turns/tools/tool-outcome.js.map +1 -1
- package/dist/core/turns/tools/web-helpers.d.ts +3 -3
- package/dist/core/turns/tools/web-helpers.d.ts.map +1 -1
- package/dist/core/turns/tools/web-helpers.js +59 -42
- package/dist/core/turns/tools/web-helpers.js.map +1 -1
- package/dist/core/turns/view-model.d.ts.map +1 -1
- package/dist/core/turns/view-model.js +2 -10
- package/dist/core/turns/view-model.js.map +1 -1
- package/dist/kortix.esm.min.js +36 -36
- package/dist/kortix.global.js +36 -36
- package/dist/react/connector-setup.d.ts +2 -1
- package/dist/react/connector-setup.d.ts.map +1 -1
- package/dist/react/human-presence.d.ts +2 -1
- package/dist/react/human-presence.d.ts.map +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react/query-contracts.d.ts +13 -0
- package/dist/react/query-contracts.d.ts.map +1 -1
- package/dist/react/query-contracts.js +36 -0
- package/dist/react/query-contracts.js.map +1 -1
- package/dist/react/query-keys.d.ts +12 -0
- package/dist/react/query-keys.d.ts.map +1 -1
- package/dist/react/query-keys.js +12 -0
- package/dist/react/query-keys.js.map +1 -1
- package/dist/react/session-stop.d.ts +2 -1
- package/dist/react/session-stop.d.ts.map +1 -1
- package/dist/react/session-title-sync.d.ts +0 -7
- package/dist/react/session-title-sync.d.ts.map +1 -1
- package/dist/react/session-title-sync.js +1 -1
- package/dist/react/session-title-sync.js.map +1 -1
- package/dist/react/sign-in-with-kortix.d.ts +1 -1
- package/dist/react/teams-install-polling.d.ts +0 -2
- package/dist/react/teams-install-polling.d.ts.map +1 -1
- package/dist/react/teams-install-polling.js +1 -1
- package/dist/react/teams-install-polling.js.map +1 -1
- package/dist/react/use-accounts.d.ts +2 -0
- package/dist/react/use-accounts.d.ts.map +1 -1
- package/dist/react/use-admin-accounts.d.ts +1 -3
- package/dist/react/use-admin-accounts.d.ts.map +1 -1
- package/dist/react/use-admin-accounts.js +3 -6
- package/dist/react/use-admin-accounts.js.map +1 -1
- package/dist/react/use-impersonation.d.ts +8 -1
- package/dist/react/use-impersonation.d.ts.map +1 -1
- package/dist/react/use-impersonation.js +17 -4
- package/dist/react/use-impersonation.js.map +1 -1
- package/dist/react/use-notifications.d.ts +1 -0
- package/dist/react/use-notifications.d.ts.map +1 -1
- package/dist/react/use-project-name.d.ts.map +1 -1
- package/dist/react/use-project-name.js +12 -18
- package/dist/react/use-project-name.js.map +1 -1
- package/dist/react/use-project-triggers.d.ts +98 -7
- package/dist/react/use-project-triggers.d.ts.map +1 -1
- package/dist/react/use-project-triggers.js +53 -7
- package/dist/react/use-project-triggers.js.map +1 -1
- package/dist/react/use-session-sync.d.ts +1 -1
- package/dist/react/use-session.d.ts +1 -1
- package/package.json +2 -2
- package/dist/core/stream/keepalive.d.ts +0 -17
- package/dist/core/stream/keepalive.d.ts.map +0 -1
- package/dist/core/stream/keepalive.js +0 -19
- package/dist/core/stream/keepalive.js.map +0 -1
|
@@ -16,9 +16,8 @@
|
|
|
16
16
|
* the give-up "parked" terminal state for streams pointed at dead sandboxes
|
|
17
17
|
* (see `maxConsecutiveHardFailures`/`onParked`).
|
|
18
18
|
*/
|
|
19
|
-
import {
|
|
19
|
+
import { CONNECT_TIMEOUT_MS, HEARTBEAT_MS, MAX_CONSECUTIVE_HARD_FAILURES, abortableDelay, connectAttempt, createEventCoalescer, dispatchToStreamSubscribers, isHardAttemptFailure, parkStream, reconnectDelay, } from './event-attempt.js';
|
|
20
20
|
import { getClientForUrl } from '../runtime/client.js';
|
|
21
|
-
import { isAuthFailure } from '../http/api/errors.js';
|
|
22
21
|
import { logger } from '../http/logger.js';
|
|
23
22
|
const realTimers = {
|
|
24
23
|
now: () => Date.now(),
|
|
@@ -26,107 +25,12 @@ const realTimers = {
|
|
|
26
25
|
clearTimeout: (handle) => clearTimeout(handle),
|
|
27
26
|
random: () => Math.random(),
|
|
28
27
|
};
|
|
29
|
-
// ---- Tunables ----
|
|
30
|
-
const COALESCE_FLUSH_MS = 16;
|
|
31
|
-
const YIELD_INTERVAL_MS = 8;
|
|
32
|
-
/**
|
|
33
|
-
* Idle watchdog budget for an ESTABLISHED stream. The sandbox daemon injects a
|
|
34
|
-
* typed `kortix.keepalive` event every 20 s into the proxied runtime event
|
|
35
|
-
* stream (`SSE_KEEPALIVE_INTERVAL_MS` in
|
|
36
|
-
* `apps/kortix-sandbox-agent-server/src/routes/proxy/sse-keepalive.ts`), so a
|
|
37
|
-
* quiet session is never silent. 60 s is three missed keepalives: the watchdog
|
|
38
|
-
* fires when the path (daemon → edge → API → client) is dead, not on one late
|
|
39
|
-
* frame. The API session stream sends its own `kortix.stream.heartbeat` every
|
|
40
|
-
* 15 s (`STREAM_HEARTBEAT_MS`). Configurable per-stream via
|
|
41
|
-
* `OpenEventStreamOptions.heartbeatTimeoutMs`.
|
|
42
|
-
*/
|
|
43
|
-
const HEARTBEAT_MS = 60_000;
|
|
44
28
|
const GAP_REHYDRATE_MS = 5_000;
|
|
45
|
-
const FAST_RECONNECT_DELAY_MS = 250;
|
|
46
|
-
const BASE_RECONNECT_DELAY_MS = 1000;
|
|
47
|
-
const MAX_RECONNECT_DELAY_MS = 30_000;
|
|
48
|
-
const MAX_BACKOFF_EXPONENT = 5;
|
|
49
29
|
/** A worked stream that closes sooner than this is not "stable"... */
|
|
50
30
|
const STABLE_LIFETIME_MS = 10_000;
|
|
51
31
|
/** ...and this many of them in a row drop the fast path (a server that sends
|
|
52
32
|
* one frame and closes would otherwise reconnect 4 times a second). */
|
|
53
33
|
const MAX_CONSECUTIVE_SHORT_STABLE = 4;
|
|
54
|
-
/** Reconnect delays stretch by up to this fraction, so a restart does not
|
|
55
|
-
* bring every client back in lockstep. */
|
|
56
|
-
const RECONNECT_JITTER = 0.5;
|
|
57
|
-
const SSE_DEFAULT_RETRY_DELAY_MS = 3000;
|
|
58
|
-
const SSE_MAX_RETRY_DELAY_MS = 30_000;
|
|
59
|
-
const CONNECT_TIMEOUT_MS = 20_000;
|
|
60
|
-
/** An event-less attempt that dies faster than this is a "hard failure" —
|
|
61
|
-
* the fast-503 signature of a dead sandbox — even when the error carries no
|
|
62
|
-
* HTTP status (edge-generated failures surface as opaque network/CORS
|
|
63
|
-
* errors). See `maxConsecutiveHardFailures`. */
|
|
64
|
-
const HARD_FAILURE_WINDOW_MS = 2_000;
|
|
65
|
-
const MAX_CONSECUTIVE_HARD_FAILURES = 8;
|
|
66
|
-
/**
|
|
67
|
-
* Coalescing keys — determines which events can replace earlier ones in the
|
|
68
|
-
* same 16ms flush batch.
|
|
69
|
-
*
|
|
70
|
-
* NOTE: message.part.updated is intentionally NOT coalesced. While the server
|
|
71
|
-
* sends full part state each time, coalescing can cause a stale snapshot to be
|
|
72
|
-
* the sole survivor of a batch. When that stale snapshot is processed before
|
|
73
|
-
* any deltas, it inserts the part with wrong/partial text (prefix-growth guard
|
|
74
|
-
* can't help — nothing to compare against). The upsertPart prefix-growth guard
|
|
75
|
-
* efficiently rejects stale snapshots with a no-op return, so processing every
|
|
76
|
-
* snapshot has minimal cost.
|
|
77
|
-
*/
|
|
78
|
-
function getCoalesceKey(event) {
|
|
79
|
-
if (event.type === 'session.status') {
|
|
80
|
-
return `session.status:${event.properties.sessionID}`;
|
|
81
|
-
}
|
|
82
|
-
if (event.type === 'lsp.updated')
|
|
83
|
-
return 'lsp.updated';
|
|
84
|
-
return undefined;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Text-delta coalescing: `next` appended to `tail` as ONE event, when both are
|
|
88
|
-
* deltas of the same part field. Else undefined.
|
|
89
|
-
*
|
|
90
|
-
* Only the queue's TAIL is ever merged into, so a run never crosses another
|
|
91
|
-
* event and dispatch order stays the wire order. The merged event carries the
|
|
92
|
-
* joined `delta`, the last wire event's `id`, and every wire event it replaced
|
|
93
|
-
* in `coalesced`: a consumer that dedupes by event id (the sync store) still
|
|
94
|
-
* sees each one.
|
|
95
|
-
*/
|
|
96
|
-
function mergePartDelta(tail, next) {
|
|
97
|
-
if (tail?.type !== 'message.part.delta' || next.type !== 'message.part.delta')
|
|
98
|
-
return undefined;
|
|
99
|
-
const a = tail.properties;
|
|
100
|
-
const b = next.properties;
|
|
101
|
-
if (a.partID !== b.partID ||
|
|
102
|
-
a.field !== b.field ||
|
|
103
|
-
a.messageID !== b.messageID ||
|
|
104
|
-
a.sessionID !== b.sessionID) {
|
|
105
|
-
return undefined;
|
|
106
|
-
}
|
|
107
|
-
// The list is this module's own (made on a run's first merge), so it grows in place.
|
|
108
|
-
const wire = tail.coalesced ?? [tail];
|
|
109
|
-
wire.push(next);
|
|
110
|
-
return { ...next, properties: { ...b, delta: a.delta + b.delta }, coalesced: wire };
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* A promise that resolves the moment `signal` fires 'abort' (or immediately,
|
|
114
|
-
* if it's already aborted), plus a `cleanup` to remove the listener when it
|
|
115
|
-
* loses a race. Used to make an in-flight `iterator.next()` read abortable:
|
|
116
|
-
* without this, a parked read (server stops sending, no error, no close)
|
|
117
|
-
* would never let a fired heartbeat/abort be observed, since nothing wakes
|
|
118
|
-
* the pending read.
|
|
119
|
-
*/
|
|
120
|
-
function onceAborted(signal) {
|
|
121
|
-
if (signal.aborted)
|
|
122
|
-
return { promise: Promise.resolve(), cleanup: () => { } };
|
|
123
|
-
let handler = () => { };
|
|
124
|
-
const promise = new Promise((resolve) => {
|
|
125
|
-
handler = () => resolve();
|
|
126
|
-
signal.addEventListener('abort', handler, { once: true });
|
|
127
|
-
});
|
|
128
|
-
return { promise, cleanup: () => signal.removeEventListener('abort', handler) };
|
|
129
|
-
}
|
|
130
34
|
/**
|
|
131
35
|
* Fans out ONE live SSE connection per client to every open subscriber — see
|
|
132
36
|
* the shared-stream fan-out invariant documented on `openEventStream` below.
|
|
@@ -165,19 +69,7 @@ function createLiveStream(client, opts, subscribers) {
|
|
|
165
69
|
const abortController = new AbortController();
|
|
166
70
|
/** Calls `fn` on every current subscriber. A throwing subscriber must
|
|
167
71
|
* never break dispatch to the others or crash the host. */
|
|
168
|
-
|
|
169
|
-
for (const sub of subscribers) {
|
|
170
|
-
const fn = pick(sub);
|
|
171
|
-
if (!fn)
|
|
172
|
-
continue;
|
|
173
|
-
try {
|
|
174
|
-
fn(...args);
|
|
175
|
-
}
|
|
176
|
-
catch (e) {
|
|
177
|
-
console.warn('[opencode-events] subscriber handler threw, skipping', e);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
72
|
+
const dispatchToSubscribers = (pick, ...args) => dispatchToStreamSubscribers(subscribers, pick, ...args);
|
|
181
73
|
let connectionState = null;
|
|
182
74
|
let parked = false;
|
|
183
75
|
const setConnectionState = (state) => {
|
|
@@ -198,40 +90,36 @@ function createLiveStream(client, opts, subscribers) {
|
|
|
198
90
|
// stream subscribes. Survives failed attempts, so a run of failed connects
|
|
199
91
|
// still ends in exactly one rehydrate.
|
|
200
92
|
let pendingGap = null;
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
let lastFlush = 0;
|
|
205
|
-
// Coalescing map — replaces earlier events of the same key
|
|
206
|
-
const coalesced = new Map();
|
|
207
|
-
const flush = () => {
|
|
208
|
-
if (flushTimer)
|
|
209
|
-
t.clearTimeout(flushTimer);
|
|
210
|
-
flushTimer = undefined;
|
|
211
|
-
if (queue.length === 0)
|
|
212
|
-
return;
|
|
213
|
-
const events = queue;
|
|
214
|
-
queue = [];
|
|
215
|
-
coalesced.clear();
|
|
216
|
-
lastFlush = t.now();
|
|
93
|
+
const coalescer = createEventCoalescer(t, (event) => {
|
|
94
|
+
// A flush that delivered events is stream activity: the gap clock
|
|
95
|
+
// restarts here (see `pendingGap`).
|
|
217
96
|
lastStreamActivityTime = t.now();
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
97
|
+
dispatchToSubscribers((sub) => sub.onEvent, event);
|
|
98
|
+
});
|
|
99
|
+
const attemptDeps = {
|
|
100
|
+
client,
|
|
101
|
+
t,
|
|
102
|
+
connectTimeoutMs,
|
|
103
|
+
heartbeatTimeoutMs,
|
|
104
|
+
outerSignal: abortController.signal,
|
|
105
|
+
setConnectionState,
|
|
106
|
+
onConnected: () => {
|
|
107
|
+
// Repair the previous drop now that a live stream exists. The gap runs
|
|
108
|
+
// from the last frame received to this connection. A dropped stream
|
|
109
|
+
// that was delivering events always repairs — its outage window may
|
|
110
|
+
// have held any frame. An idle one repairs only past 5s, so routine
|
|
111
|
+
// idle rotation does not re-read every transcript.
|
|
112
|
+
if (pendingGap) {
|
|
113
|
+
const gap = t.now() - pendingGap.lastActivityAt;
|
|
114
|
+
const eventful = pendingGap.eventful;
|
|
115
|
+
pendingGap = null;
|
|
116
|
+
if (eventful || gap > GAP_REHYDRATE_MS) {
|
|
117
|
+
dispatchToSubscribers((sub) => sub.onGapRehydrate, gap);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
lastStreamActivityTime = t.now();
|
|
121
|
+
},
|
|
122
|
+
coalescer,
|
|
235
123
|
};
|
|
236
124
|
// Consume the stream in the background with automatic retry
|
|
237
125
|
(async () => {
|
|
@@ -242,238 +130,12 @@ function createLiveStream(client, opts, subscribers) {
|
|
|
242
130
|
let consecutiveHardFailures = 0;
|
|
243
131
|
let consecutiveShortStable = 0;
|
|
244
132
|
while (!abortController.signal.aborted) {
|
|
245
|
-
// Events other than the connection's own `server.connected` greeting.
|
|
246
|
-
let streamHadWork = false;
|
|
247
|
-
let stableConnection = false;
|
|
248
|
-
let heartbeatTimer;
|
|
249
|
-
let connectTimer;
|
|
250
|
-
// What this attempt died to (null = clean end), plus when it started —
|
|
251
|
-
// both feed the hard-failure classification below the try block.
|
|
252
|
-
let attemptError = null;
|
|
253
133
|
const attemptStartedAt = t.now();
|
|
254
|
-
|
|
255
|
-
// actually cancels the underlying network reader — the vendor client
|
|
256
|
-
// only cancels on the signal IT was handed. It aborts when EITHER the
|
|
257
|
-
// heartbeat fires OR the outer controller aborts (linked below), so a
|
|
258
|
-
// heartbeat-forced reconnect tears the old connection down instead of
|
|
259
|
-
// leaving it parked/leaking while a new one opens.
|
|
260
|
-
const attemptAbort = new AbortController();
|
|
261
|
-
setConnectionState('connecting');
|
|
262
|
-
const outerLink = onceAborted(abortController.signal);
|
|
263
|
-
outerLink.promise.then(() => attemptAbort.abort());
|
|
264
|
-
try {
|
|
265
|
-
// Race the connect call itself against `connectTimeoutMs`. A
|
|
266
|
-
// black-holed proxy can swallow this request with no error, no data,
|
|
267
|
-
// and no close — the heartbeat watchdog below only starts once this
|
|
268
|
-
// resolves, so it can't rescue a hung connect. On timeout, abort this
|
|
269
|
-
// attempt (cancels the underlying request, same as any other
|
|
270
|
-
// reconnect) and reject so it falls into the catch block below and
|
|
271
|
-
// retries through the normal backoff path, exactly like any other
|
|
272
|
-
// connect failure.
|
|
273
|
-
const result = await new Promise((resolve, reject) => {
|
|
274
|
-
let settled = false;
|
|
275
|
-
connectTimer = t.setTimeout(() => {
|
|
276
|
-
if (settled)
|
|
277
|
-
return;
|
|
278
|
-
settled = true;
|
|
279
|
-
logger.warn('SSE connect timed out, forcing reconnect', { connectTimeoutMs });
|
|
280
|
-
attemptAbort.abort();
|
|
281
|
-
reject(new Error(`SSE connect timed out after ${connectTimeoutMs}ms`));
|
|
282
|
-
}, connectTimeoutMs);
|
|
283
|
-
client.global
|
|
284
|
-
.event({
|
|
285
|
-
signal: attemptAbort.signal,
|
|
286
|
-
sseDefaultRetryDelay: SSE_DEFAULT_RETRY_DELAY_MS,
|
|
287
|
-
sseMaxRetryDelay: SSE_MAX_RETRY_DELAY_MS,
|
|
288
|
-
// CRITICAL: caps the vendor client's OWN internal reconnect loop
|
|
289
|
-
// to a single attempt. `@opencode-ai/sdk`'s `createSseClient`
|
|
290
|
-
// wraps every connection in its own `while(true)` retry-with-
|
|
291
|
-
// backoff generator that swallows failures and silently
|
|
292
|
-
// schedules its next fetch via a plain `setTimeout` sleep that
|
|
293
|
-
// does NOT observe `signal` — aborting mid-sleep only stops it
|
|
294
|
-
// once the sleep elapses and the generator wakes up to check
|
|
295
|
-
// `signal.aborted`. Left unset (the old default), that inner
|
|
296
|
-
// loop runs CONCURRENTLY with this module's own outer
|
|
297
|
-
// connect/backoff loop below: the moment we abort a stalled
|
|
298
|
-
// attempt (heartbeat timeout, gap reconnect, or a fresh `close()`)
|
|
299
|
-
// and immediately open the next one, the previous vendor-level
|
|
300
|
-
// generator can still be mid-sleep and — on a race — wakes up
|
|
301
|
-
// and fires ONE MORE fetch before it finally notices the abort,
|
|
302
|
-
// stacking a second live connection on top of the new attempt.
|
|
303
|
-
// On a flaky self-host sandbox (frequent brief-unreachable →
|
|
304
|
-
// reconnect cycles) this piles up fast: every retry can leave a
|
|
305
|
-
// stray in-flight fetch behind, and under HTTP/1.1's 6-per-origin
|
|
306
|
-
// cap those leaked connections alone can saturate the pool and
|
|
307
|
-
// queue out every other request (/projects, /sessions, ...).
|
|
308
|
-
// Setting this to 1 makes a failed fetch complete the generator
|
|
309
|
-
// (a clean `done`, no throw, no internal retry/sleep) instead of
|
|
310
|
-
// scheduling its own reconnect — so THIS module's outer loop is
|
|
311
|
-
// the only thing that ever decides to open a new connection, and
|
|
312
|
-
// it only ever does so after the previous attempt's
|
|
313
|
-
// `attemptAbort.abort()` has already run (see the `finally`
|
|
314
|
-
// block below).
|
|
315
|
-
sseMaxRetryAttempts: 1,
|
|
316
|
-
})
|
|
317
|
-
.then((value) => {
|
|
318
|
-
if (settled)
|
|
319
|
-
return;
|
|
320
|
-
settled = true;
|
|
321
|
-
t.clearTimeout(connectTimer);
|
|
322
|
-
resolve(value);
|
|
323
|
-
}, (err) => {
|
|
324
|
-
if (settled)
|
|
325
|
-
return;
|
|
326
|
-
settled = true;
|
|
327
|
-
t.clearTimeout(connectTimer);
|
|
328
|
-
reject(err);
|
|
329
|
-
});
|
|
330
|
-
});
|
|
331
|
-
const { stream } = result;
|
|
332
|
-
// Repair the previous drop now that a live stream exists. The gap runs
|
|
333
|
-
// from the last frame received to this connection. A dropped stream
|
|
334
|
-
// that was delivering events always repairs — its outage window may
|
|
335
|
-
// have held any frame. An idle one repairs only past 5s, so routine
|
|
336
|
-
// idle rotation does not re-read every transcript.
|
|
337
|
-
if (pendingGap) {
|
|
338
|
-
const gap = t.now() - pendingGap.lastActivityAt;
|
|
339
|
-
const eventful = pendingGap.eventful;
|
|
340
|
-
pendingGap = null;
|
|
341
|
-
if (eventful || gap > GAP_REHYDRATE_MS) {
|
|
342
|
-
dispatchToSubscribers((sub) => sub.onGapRehydrate, gap);
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
lastStreamActivityTime = t.now();
|
|
346
|
-
// Heartbeat timeout — if no events arrive within the idle budget
|
|
347
|
-
// (default 60s, see HEARTBEAT_MS for why), abort and reconnect. This
|
|
348
|
-
// is the ONLY recovery mechanism we need on an established stream —
|
|
349
|
-
// replaces the stall watchdog, reconciler, and visibility handler.
|
|
350
|
-
const resetHeartbeat = () => {
|
|
351
|
-
t.clearTimeout(heartbeatTimer);
|
|
352
|
-
heartbeatTimer = t.setTimeout(() => {
|
|
353
|
-
logger.warn('SSE heartbeat timeout, forcing reconnect');
|
|
354
|
-
attemptAbort.abort();
|
|
355
|
-
}, heartbeatTimeoutMs);
|
|
356
|
-
};
|
|
357
|
-
resetHeartbeat();
|
|
358
|
-
// Consume stream: queue + coalesce + 16ms flush + yield every 8ms.
|
|
359
|
-
//
|
|
360
|
-
// The read itself has to be abortable, not just checked between
|
|
361
|
-
// reads. If the underlying `.next()` parks (server stops sending, no
|
|
362
|
-
// error, no close), a plain `for await` never yields control back to
|
|
363
|
-
// this loop body, so a heartbeat/abort that fires while parked would
|
|
364
|
-
// never actually be observed. Race each read against the
|
|
365
|
-
// heartbeat/abort signals instead — whichever settles first wins.
|
|
366
|
-
let yieldedAt = t.now();
|
|
367
|
-
const iterator = stream[Symbol.asyncIterator]();
|
|
368
|
-
while (!attemptAbort.signal.aborted) {
|
|
369
|
-
const nextOutcome = iterator.next().then((result) => ({ kind: 'next', result }), (error) => ({ kind: 'error', error }));
|
|
370
|
-
const abortWatch = onceAborted(attemptAbort.signal);
|
|
371
|
-
const outcome = await Promise.race([
|
|
372
|
-
nextOutcome,
|
|
373
|
-
abortWatch.promise.then(() => ({ kind: 'aborted' })),
|
|
374
|
-
]);
|
|
375
|
-
abortWatch.cleanup();
|
|
376
|
-
if (outcome.kind === 'aborted')
|
|
377
|
-
break;
|
|
378
|
-
if (outcome.kind === 'error')
|
|
379
|
-
throw outcome.error;
|
|
380
|
-
if (outcome.result.done)
|
|
381
|
-
break;
|
|
382
|
-
setConnectionState('open');
|
|
383
|
-
resetHeartbeat();
|
|
384
|
-
const raw = outcome.result.value;
|
|
385
|
-
const e = (raw && typeof raw === 'object' && 'payload' in raw ? raw.payload : raw);
|
|
386
|
-
if (!e?.type)
|
|
387
|
-
continue;
|
|
388
|
-
// The connection's own greeting is not work that a drop could lose.
|
|
389
|
-
if (e.type !== 'server.connected')
|
|
390
|
-
streamHadWork = true;
|
|
391
|
-
// The tail is never a replaced slot: a replacement pushes right after.
|
|
392
|
-
const merged = mergePartDelta(queue[queue.length - 1]?.event, e);
|
|
393
|
-
if (merged) {
|
|
394
|
-
queue[queue.length - 1] = { type: merged.type, event: merged };
|
|
395
|
-
}
|
|
396
|
-
else {
|
|
397
|
-
const ck = getCoalesceKey(e);
|
|
398
|
-
if (ck) {
|
|
399
|
-
const existing = coalesced.get(ck);
|
|
400
|
-
if (existing !== undefined) {
|
|
401
|
-
queue[existing] = undefined;
|
|
402
|
-
}
|
|
403
|
-
coalesced.set(ck, queue.length);
|
|
404
|
-
}
|
|
405
|
-
queue.push({ type: e.type, event: e });
|
|
406
|
-
}
|
|
407
|
-
schedule();
|
|
408
|
-
if (t.now() - yieldedAt < YIELD_INTERVAL_MS)
|
|
409
|
-
continue;
|
|
410
|
-
await new Promise((resolve) => t.setTimeout(resolve, 0));
|
|
411
|
-
// The budget starts when reading resumes. The host renders inside the
|
|
412
|
-
// yield; counting that wait as reading made every later event yield
|
|
413
|
-
// again, one event per render, so the transcript trailed the wire.
|
|
414
|
-
yieldedAt = t.now();
|
|
415
|
-
}
|
|
416
|
-
// Healthy stream ONLY if it actually delivered events. There used to
|
|
417
|
-
// be a time-based OR-branch here ("or stayed open >10s") — that was a
|
|
418
|
-
// prod reconnect storm: anything that kills idle connections on a
|
|
419
|
-
// period ABOVE that threshold (our own heartbeat watchdog, an idle
|
|
420
|
-
// proxy timeout, server-side rotation) made every idle disconnect
|
|
421
|
-
// look "stable", which reset retryCount and locked the loop into the
|
|
422
|
-
// 250ms fast-reconnect path forever (~236 reconnects/hour/stream).
|
|
423
|
-
// An idle disconnect — watchdog-triggered or natural — must ride the
|
|
424
|
-
// exponential backoff (1s → 30s cap) instead; the moment a
|
|
425
|
-
// reconnected stream delivers a real event, backoff resets and the
|
|
426
|
-
// fast path returns. Missed-while-waiting events are covered by the
|
|
427
|
-
// gap-rehydrate signal below.
|
|
428
|
-
stableConnection = streamHadWork;
|
|
429
|
-
}
|
|
430
|
-
catch (err) {
|
|
431
|
-
if (abortController.signal.aborted)
|
|
432
|
-
break;
|
|
433
|
-
attemptError = err;
|
|
434
|
-
const errStr = String(err);
|
|
435
|
-
// By status or `AuthError`, never by message text. The vendor client puts
|
|
436
|
-
// the HTTP status on `cause`.
|
|
437
|
-
const isAuthError = isAuthFailure(err) || isAuthFailure(err?.cause);
|
|
438
|
-
logger.error('SSE event stream error', {
|
|
439
|
-
error: errStr,
|
|
440
|
-
retryCount,
|
|
441
|
-
isAuthError,
|
|
442
|
-
});
|
|
443
|
-
// On auth errors, invalidate the token cache and fetch a fresh token.
|
|
444
|
-
// This ensures all callers (SSE, health check, SDK) immediately use
|
|
445
|
-
// the refreshed token instead of serving stale cached ones for 30s.
|
|
446
|
-
if (isAuthError) {
|
|
447
|
-
try {
|
|
448
|
-
invalidateTokenCache();
|
|
449
|
-
await getSupabaseAccessToken();
|
|
450
|
-
logger.info('SSE: refreshed auth token after auth error');
|
|
451
|
-
}
|
|
452
|
-
catch (refreshErr) {
|
|
453
|
-
logger.error('SSE: failed to refresh auth token', {
|
|
454
|
-
error: String(refreshErr),
|
|
455
|
-
});
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
finally {
|
|
460
|
-
t.clearTimeout(heartbeatTimer);
|
|
461
|
-
t.clearTimeout(connectTimer);
|
|
462
|
-
// Release the reader/connection if we left the loop for any reason
|
|
463
|
-
// other than an already-fired abort (e.g. stream `done`, or a thrown
|
|
464
|
-
// error), and detach the outer-abort listener so it can't accumulate
|
|
465
|
-
// across reconnects.
|
|
466
|
-
attemptAbort.abort();
|
|
467
|
-
outerLink.cleanup();
|
|
468
|
-
flush();
|
|
469
|
-
}
|
|
470
|
-
// Stream ended or errored — reconnect with exponential backoff.
|
|
471
|
-
// ERR_INCOMPLETE_CHUNKED_ENCODING is normal when the server closes the
|
|
472
|
-
// SSE connection between response cycles. Minimum 1s delay even on
|
|
473
|
-
// first retry to avoid reconnection storms when the server is flapping
|
|
474
|
-
// (connect → immediate disconnect loops).
|
|
134
|
+
const outcome = await connectAttempt({ ...attemptDeps, retryCount });
|
|
475
135
|
if (abortController.signal.aborted)
|
|
476
136
|
break;
|
|
137
|
+
const attemptError = outcome.error;
|
|
138
|
+
const { streamHadWork, stableConnection } = outcome;
|
|
477
139
|
// ── Give-up (park) check — the "dead sandbox" terminal state. ────────
|
|
478
140
|
// A stream pointed at an archived/stopped session's sandbox otherwise
|
|
479
141
|
// retries FOREVER: the proxy 503s every `/global/event` connect, and
|
|
@@ -488,28 +150,12 @@ function createLiveStream(client, opts, subscribers) {
|
|
|
488
150
|
// the streak. After `maxConsecutiveHardFailures` in a row — spread
|
|
489
151
|
// over ~2 minutes by the exponential backoff below — park for good.
|
|
490
152
|
const attemptDurationMs = t.now() - attemptStartedAt;
|
|
491
|
-
const
|
|
492
|
-
// A greeting alone is not delivery: a proxy that says hello and closes
|
|
493
|
-
// is as dead as one that refuses the connect.
|
|
494
|
-
const isHardFailure = !streamHadWork &&
|
|
495
|
-
((typeof httpStatus === 'number' && httpStatus >= 400) ||
|
|
496
|
-
attemptDurationMs < HARD_FAILURE_WINDOW_MS);
|
|
153
|
+
const isHardFailure = isHardAttemptFailure(streamHadWork, attemptError, attemptDurationMs);
|
|
497
154
|
consecutiveHardFailures = isHardFailure ? consecutiveHardFailures + 1 : 0;
|
|
498
155
|
if (consecutiveHardFailures >= maxConsecutiveHardFailures) {
|
|
499
|
-
|
|
500
|
-
consecutiveFailures: consecutiveHardFailures,
|
|
501
|
-
lastError: String(attemptError),
|
|
502
|
-
});
|
|
503
|
-
// A subscriber's park handler must never crash the (already-
|
|
504
|
-
// terminal) stream machine, and must never stop another
|
|
505
|
-
// subscriber's from firing — `dispatchToSubscribers` catches per
|
|
506
|
-
// subscriber.
|
|
156
|
+
parkStream(subscribers, consecutiveHardFailures, attemptError);
|
|
507
157
|
connectionState = null;
|
|
508
158
|
parked = true;
|
|
509
|
-
dispatchToSubscribers((sub) => sub.onParked, {
|
|
510
|
-
consecutiveFailures: consecutiveHardFailures,
|
|
511
|
-
lastError: attemptError,
|
|
512
|
-
});
|
|
513
159
|
break;
|
|
514
160
|
}
|
|
515
161
|
setConnectionState('lost');
|
|
@@ -536,18 +182,7 @@ function createLiveStream(client, opts, subscribers) {
|
|
|
536
182
|
logger.warn('SSE event stream reconnecting', { retryCount });
|
|
537
183
|
}
|
|
538
184
|
}
|
|
539
|
-
|
|
540
|
-
? FAST_RECONNECT_DELAY_MS
|
|
541
|
-
: Math.min(BASE_RECONNECT_DELAY_MS * 2 ** Math.min(retryCount - 1, MAX_BACKOFF_EXPONENT), MAX_RECONNECT_DELAY_MS);
|
|
542
|
-
const delay = Math.round(baseDelay * (1 + RECONNECT_JITTER * (t.random?.() ?? 0)));
|
|
543
|
-
await new Promise((resolve) => {
|
|
544
|
-
const timer = t.setTimeout(resolve, delay);
|
|
545
|
-
const onAbort = () => {
|
|
546
|
-
t.clearTimeout(timer);
|
|
547
|
-
resolve();
|
|
548
|
-
};
|
|
549
|
-
abortController.signal.addEventListener('abort', onAbort, { once: true });
|
|
550
|
-
});
|
|
185
|
+
await abortableDelay(t, abortController.signal, reconnectDelay(retryCount, fastPath, t));
|
|
551
186
|
}
|
|
552
187
|
})();
|
|
553
188
|
return {
|
|
@@ -557,8 +192,7 @@ function createLiveStream(client, opts, subscribers) {
|
|
|
557
192
|
teardown: () => {
|
|
558
193
|
connectionState = null;
|
|
559
194
|
abortController.abort();
|
|
560
|
-
|
|
561
|
-
t.clearTimeout(flushTimer);
|
|
195
|
+
coalescer.clearTimer();
|
|
562
196
|
},
|
|
563
197
|
};
|
|
564
198
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-stream.js","sourceRoot":"","sources":["../../../src/core/stream/event-stream.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AA0CxC,MAAM,UAAU,GAAsB;IACpC,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;IACrB,UAAU,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,SAAS,CAAC;IAClE,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC;IAC9C,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE;CAC5B,CAAC;AA+FF,qBAAqB;AACrB,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAC7B,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B;;;;;;;;;;GAUG;AACH,MAAM,YAAY,GAAG,MAAM,CAAC;AAC5B,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAC/B,MAAM,uBAAuB,GAAG,GAAG,CAAC;AACpC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AACrC,MAAM,sBAAsB,GAAG,MAAM,CAAC;AACtC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAC/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