@ai-sdk/harness-claude-code 1.0.167 → 1.0.169

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/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { HARNESS_V1_BUILTIN_TOOLS, HarnessV1, HarnessV1Authentication, HarnessV1BuiltinTool, HarnessV1CredentialForwarding, HarnessV1MintBridgeTokenCallback, HarnessV1PortEndpoint } from "@ai-sdk/harness";
2
- import { SandboxChannelReconnectOptions } from "@ai-sdk/harness/utils";
2
+ import { SandboxChannelDebugEvent, SandboxChannelReconnectOptions } from "@ai-sdk/harness/utils";
3
3
  import { Experimental_SandboxSession } from "@ai-sdk/provider-utils";
4
4
  import { JSONObject } from "@ai-sdk/provider";
5
5
  //#region src/claude-code-auth.d.ts
@@ -78,6 +78,14 @@ type ClaudeCodeHarnessSettings = {
78
78
  * milliseconds up to 2 seconds.
79
79
  */
80
80
  readonly reconnect?: SandboxChannelReconnectOptions;
81
+ /**
82
+ * Called with bridge connection lifecycle events: reconnect attempts,
83
+ * successful reconnects, and `reconnect-failed` once the connection is
84
+ * closed for good. Hosts that cache idle sessions can use it to reattach
85
+ * before sending the next prompt. The `cause` of a failed reconnect can
86
+ * contain connection details, so avoid logging it as is.
87
+ */
88
+ readonly onDebug?: (event: SandboxChannelDebugEvent) => void;
81
89
  /**
82
90
  * Creates the authentication token used by the sandbox bridge. Defaults to
83
91
  * a random 32-byte hexadecimal token.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["SandboxSession"],"sources":["../src/claude-code-auth.ts","../src/claude-code-thinking.ts","../src/claude-code-harness.ts","../src/version.ts","../src/index.ts"],"mappings":";;;;;KAwEY,+BAA+B;;;KCxE/B;WAEG;WACA;;WAGA;;;;KCgFH;WACD,OAAO;;;;;;WAMP,uBAAuB;;;;;WAKvB,aAAa;;;;;WAKb;;;;;WAKA;;;;;WAKA;;;;;WAKA,MAAM,SAAS;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAQgu1D;MAAoC;;;QAAmE;QAAsC;;MAAiE;MAA2C;;;;;;;;MAA4K;;;;;;MAAgJ"}
1
+ {"version":3,"file":"index.d.ts","names":["SandboxSession"],"sources":["../src/claude-code-auth.ts","../src/claude-code-thinking.ts","../src/claude-code-harness.ts","../src/version.ts","../src/index.ts"],"mappings":";;;;;KAwEY,+BAA+B;;;KCxE/B;WAEG;WACA;;WAGA;;;;KCkFH;WACD,OAAO;;;;;;WAMP,uBAAuB;;;;;WAKvB,aAAa;;;;;WAKb;;;;;WAK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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAQgu1D;MAAoC;;;QAAmE;QAAsC;;MAAiE;MAA2C;;;;;;;;MAA4K;;;;;;MAAgJ"}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { dirname, join, posix, resolve } from "node:path";
2
2
  import { HARNESS_V1_BUILTIN_TOOLS, HarnessCapabilityUnsupportedError, commonTool, harnessSessionDataDirectoryPath, harnessStateDirectoryPath, harnessV1BridgeInboundCommandSchemas, harnessV1BridgeOutboundMessageSchema, harnessV1BridgeStartBaseSchema, harnessV1DiagnosticFromBridgeFrame } from "@ai-sdk/harness";
3
- import { SandboxChannel, applyCredentialForwarding, classifyDiskLog, createBridgeErrorHandler, createBridgeStartupError, createBridgeToken, createCredentialRequestTransformation, createReadBridgeAsset, drainBridgeProcessStream, experimental_createBridgeUserMessageSubmitter, extractHarnessPromptContent, forwardBridgeProcessStream, getAiGatewayAuthFromEnv, getRestrictedSandboxSession, harnessPromptContentSchema, isAccessTokenExpiringSoon, isHarnessAuthenticationEnvironment, isMacOS, markBridgeStarting, readMacOSKeychainPassword, refreshOAuthAccessToken, resolveSandboxCredentialEnvironment, resolveSandboxHomeDir, shellQuote, shouldResolveNativeSubscription, sleep, waitForBridgeReady, warnCredentialBrokeringUnavailable, withBridgeToken, writeSkills } from "@ai-sdk/harness/utils";
3
+ import { SandboxChannel, applyCredentialForwarding, classifyDiskLog, createBridgeErrorHandler, createBridgeStartupError, createBridgeToken, createBridgeWebSocketConnect, createCredentialRequestTransformation, createReadBridgeAsset, drainBridgeProcessStream, experimental_createBridgeUserMessageSubmitter, extractHarnessPromptContent, forwardBridgeProcessStream, getAiGatewayAuthFromEnv, getRestrictedSandboxSession, harnessPromptContentSchema, isAccessTokenExpiringSoon, isHarnessAuthenticationEnvironment, isMacOS, markBridgeStarting, readMacOSKeychainPassword, refreshOAuthAccessToken, resolveBridgeEndpoint, resolveBridgePort, resolveSandboxCredentialEnvironment, resolveSandboxHomeDir, shellQuote, shouldResolveNativeSubscription, validateBridgeSandboxSettings, waitForBridgeReady, warnCredentialBrokeringUnavailable, writeSkills } from "@ai-sdk/harness/utils";
4
4
  import { isRecord, safeParseJSON, tool } from "@ai-sdk/provider-utils";
5
5
  import { WebSocket } from "ws";
6
6
  import { z } from "zod/v4";
@@ -308,7 +308,7 @@ const startMessageSchema = harnessV1BridgeStartBaseSchema.extend({
308
308
  z.discriminatedUnion("type", [startMessageSchema, ...harnessV1BridgeInboundCommandSchemas]);
309
309
  //#endregion
310
310
  //#region src/version.ts
311
- const VERSION = "1.0.167";
311
+ const VERSION = "1.0.169";
312
312
  //#endregion
313
313
  //#region src/claude-code-harness.ts
314
314
  /**
@@ -973,14 +973,12 @@ function createClaudeCode(settings = {}) {
973
973
  const sandboxSession = startOpts.sandboxSession;
974
974
  const toolSafeSandboxSession = getRestrictedSandboxSession(sandboxSession);
975
975
  const sandboxId = "id" in sandboxSession ? sandboxSession.id : void 0;
976
- validateBasicSandboxSettings({
976
+ validateBridgeSandboxSettings({
977
977
  sandboxSession,
978
- port: settings.port,
979
- portEndpoint: settings.portEndpoint
980
- });
981
- if (settings.mintBridgeToken != null && sandboxId == null) throw new HarnessCapabilityUnsupportedError({
982
- harnessId: "claude-code",
983
- message: "The Claude Code harness cannot use `mintBridgeToken` with a sandbox session that does not expose an id."
978
+ sandboxId,
979
+ portOverride: settings.port,
980
+ portEndpointOverride: settings.portEndpoint,
981
+ mintBridgeToken: settings.mintBridgeToken
984
982
  });
985
983
  const lifecycleState = startOpts.continueFrom ?? startOpts.resumeFrom;
986
984
  const isResume = lifecycleState != null;
@@ -1050,33 +1048,28 @@ function createClaudeCode(settings = {}) {
1050
1048
  sessionId: startOpts.sessionId
1051
1049
  });
1052
1050
  let supportsUserMessageResponses = false;
1053
- const buildConnect = (endpoint) => async ({ abortSignal }) => {
1054
- return openBridgeWebSocket({
1055
- endpoint,
1056
- timeoutMs,
1057
- abortSignal,
1058
- onHello: (supportsResponses) => {
1059
- supportsUserMessageResponses = supportsResponses;
1060
- }
1061
- });
1051
+ const onHello = (hello) => {
1052
+ supportsUserMessageResponses = hello.capabilities?.experimental_userMessageResponses === true;
1062
1053
  };
1063
1054
  if (coords) try {
1064
- const endpoint = await resolveBridgeEndpoint({
1055
+ const attachEndpoint = await resolveBridgeEndpoint({
1065
1056
  sandboxSession,
1066
- override: settings.portEndpoint,
1067
- port: coords.port
1068
- });
1069
- const attachEndpoint = withBridgeToken({
1070
- endpoint,
1057
+ port: coords.port,
1058
+ portEndpointOverride: settings.portEndpoint,
1071
1059
  token: coords.token
1072
1060
  });
1073
1061
  const attachChannel = new SandboxChannel({
1074
- connect: buildConnect(attachEndpoint),
1062
+ connect: createBridgeWebSocketConnect({
1063
+ endpoint: attachEndpoint,
1064
+ webSocketConstructor: WebSocket,
1065
+ onHello
1066
+ }),
1075
1067
  outboundSchema: outboundMessageSchema,
1076
1068
  initialLastSeenEventId: coords.lastSeenEventId,
1077
1069
  onDiagnostic,
1078
1070
  onBridgeError,
1079
- reconnect: settings.reconnect
1071
+ reconnect: settings.reconnect,
1072
+ onDebug: settings.onDebug
1080
1073
  });
1081
1074
  const finishListenerAttachment = isContinue ? attachChannel.beginListenerAttachment() : void 0;
1082
1075
  try {
@@ -1123,7 +1116,7 @@ function createClaudeCode(settings = {}) {
1123
1116
  }
1124
1117
  const port = resolveBridgePort({
1125
1118
  sandboxSession,
1126
- override: settings.port
1119
+ portOverride: settings.port
1127
1120
  });
1128
1121
  const token = settings.mintBridgeToken == null ? createBridgeToken() : settings.mintBridgeToken(sandboxId);
1129
1122
  const env = {
@@ -1176,21 +1169,25 @@ function createClaudeCode(settings = {}) {
1176
1169
  })
1177
1170
  });
1178
1171
  drainBridgeProcessStream(proc.stdout);
1179
- const endpoint = await resolveBridgeEndpoint({
1172
+ const bridgeEndpoint = await resolveBridgeEndpoint({
1180
1173
  sandboxSession,
1181
- override: settings.portEndpoint,
1182
- port: boundPort
1183
- });
1184
- const bridgeEndpoint = withBridgeToken({
1185
- endpoint,
1174
+ port: boundPort,
1175
+ portEndpointOverride: settings.portEndpoint,
1186
1176
  token
1187
1177
  });
1188
1178
  const channel = new SandboxChannel({
1189
- connect: buildConnect(bridgeEndpoint),
1179
+ connect: createBridgeWebSocketConnect({
1180
+ endpoint: bridgeEndpoint,
1181
+ webSocketConstructor: WebSocket,
1182
+ openRetryTimeoutMs: timeoutMs,
1183
+ startAbortSignal: startOpts.abortSignal,
1184
+ onHello
1185
+ }),
1190
1186
  outboundSchema: outboundMessageSchema,
1191
1187
  onDiagnostic,
1192
1188
  onBridgeError,
1193
1189
  reconnect: settings.reconnect,
1190
+ onDebug: settings.onDebug,
1194
1191
  ...respawnStrategy === "replay" ? { initialLastSeenEventId: coords?.lastSeenEventId ?? 0 } : {}
1195
1192
  });
1196
1193
  const finishListenerAttachment = respawnStrategy === "replay" ? channel.beginListenerAttachment() : void 0;
@@ -1230,36 +1227,6 @@ function createClaudeCode(settings = {}) {
1230
1227
  }
1231
1228
  };
1232
1229
  }
1233
- function resolveBridgePort({ sandboxSession, override }) {
1234
- if (override !== void 0) return override;
1235
- if ("ports" in sandboxSession && sandboxSession.ports.length > 0) return sandboxSession.ports[0];
1236
- throw new HarnessCapabilityUnsupportedError({
1237
- harnessId: "claude-code",
1238
- message: "The claude-code harness needs a TCP port exposed by the sandbox. Create the sandbox with `ports: [<port>]` or pass `createClaudeCode({ port })`."
1239
- });
1240
- }
1241
- function validateBasicSandboxSettings({ sandboxSession, port, portEndpoint }) {
1242
- if ("getPortEndpoint" in sandboxSession) return;
1243
- if (port == null) throw new HarnessCapabilityUnsupportedError({
1244
- harnessId: "claude-code",
1245
- message: "The Claude Code harness requires an explicit `port` when using a basic sandbox session."
1246
- });
1247
- if (portEndpoint == null) throw new HarnessCapabilityUnsupportedError({
1248
- harnessId: "claude-code",
1249
- message: "The Claude Code harness requires an explicit `portEndpoint` when using a basic sandbox session."
1250
- });
1251
- }
1252
- async function resolveBridgeEndpoint({ sandboxSession, override, port }) {
1253
- if (override != null) return override;
1254
- if ("getPortEndpoint" in sandboxSession) return sandboxSession.getPortEndpoint({
1255
- port,
1256
- protocol: "ws"
1257
- });
1258
- throw new HarnessCapabilityUnsupportedError({
1259
- harnessId: "claude-code",
1260
- message: "The Claude Code harness requires an explicit `portEndpoint` when using a basic sandbox session."
1261
- });
1262
- }
1263
1230
  /**
1264
1231
  * Materialise skill files into
1265
1232
  * `$HOME/.claude/skills/<name>/SKILL.md`. The `claude` CLI
@@ -1267,145 +1234,6 @@ async function resolveBridgeEndpoint({ sandboxSession, override, port }) {
1267
1234
  * be in place before the bridge is spawned without mutating the session
1268
1235
  * workdir. Each file uses the YAML-frontmatter shape the CLI expects.
1269
1236
  */
1270
- /**
1271
- * Wait for the bridge's `bridge-hello` message to arrive on the freshly
1272
- * opened WebSocket before any other host-side code touches it.
1273
- *
1274
- * Some sandbox runtimes (Vercel in particular) complete the WS upgrade
1275
- * with the host long before the connection is actually forwarded to the
1276
- * sandbox-side bridge. Anything sent in that gap is silently dropped —
1277
- * including the `start` message we send next. The bridge emits
1278
- * `bridge-hello` the instant it accepts the connection, so receiving it
1279
- * is the only reliable evidence that the end-to-end link is live.
1280
- */
1281
- function openWebSocketAndWaitForBridgeHello({ endpoint, openTimeoutMs, getHelloTimeoutMs, abortSignal, onHello }) {
1282
- return new Promise((resolve, reject) => {
1283
- const abortReason = () => abortSignal.reason ?? /* @__PURE__ */ new Error("WebSocket connection aborted");
1284
- if (abortSignal.aborted) {
1285
- reject(abortReason());
1286
- return;
1287
- }
1288
- const ws = new WebSocket(endpoint.url, { headers: endpoint.headers == null ? void 0 : { ...endpoint.headers } });
1289
- let opened = false;
1290
- let sawBridgeHello = false;
1291
- let settled = false;
1292
- let openTimer;
1293
- let helloTimer;
1294
- let onAbort;
1295
- const cleanup = ({ keepTerminationListeners = false } = {}) => {
1296
- if (openTimer) clearTimeout(openTimer);
1297
- if (helloTimer) clearTimeout(helloTimer);
1298
- ws.off("open", onOpen);
1299
- ws.off("message", onMessage);
1300
- if (onAbort != null) abortSignal.removeEventListener("abort", onAbort);
1301
- if (!keepTerminationListeners) {
1302
- ws.off("close", onClose);
1303
- ws.off("error", onError);
1304
- }
1305
- };
1306
- const settle = (err) => {
1307
- if (settled) return;
1308
- settled = true;
1309
- if (err) {
1310
- cleanup({ keepTerminationListeners: true });
1311
- try {
1312
- ws.terminate();
1313
- } catch {
1314
- cleanup();
1315
- }
1316
- reject(err);
1317
- } else {
1318
- cleanup();
1319
- resolve(ws);
1320
- }
1321
- };
1322
- const tryResolve = () => {
1323
- if (opened && sawBridgeHello) settle();
1324
- };
1325
- const startHelloTimer = () => {
1326
- if (helloTimer) return;
1327
- const helloTimeoutMs = getHelloTimeoutMs();
1328
- helloTimer = setTimeout(() => settle(/* @__PURE__ */ new Error(`claude-code bridge did not send bridge-hello within ${helloTimeoutMs}ms`)), helloTimeoutMs);
1329
- helloTimer.unref?.();
1330
- };
1331
- const onOpen = () => {
1332
- opened = true;
1333
- if (openTimer) {
1334
- clearTimeout(openTimer);
1335
- openTimer = void 0;
1336
- }
1337
- startHelloTimer();
1338
- tryResolve();
1339
- };
1340
- const onMessage = (raw) => {
1341
- (async () => {
1342
- const parsed = await safeParseJSON({ text: webSocketMessageToString(raw) });
1343
- if (!parsed.success || settled) return;
1344
- const value = parsed.value;
1345
- if (typeof value === "object" && value !== null && !Array.isArray(value) && value.type === "bridge-hello") {
1346
- const capabilities = value.capabilities;
1347
- onHello(capabilities?.experimental_userMessageResponses === true);
1348
- sawBridgeHello = true;
1349
- tryResolve();
1350
- }
1351
- })();
1352
- };
1353
- const onClose = () => {
1354
- settle(/* @__PURE__ */ new Error("claude-code bridge closed before sending bridge-hello"));
1355
- cleanup();
1356
- };
1357
- const onError = (err) => settle(err);
1358
- onAbort = () => settle(abortReason());
1359
- openTimer = setTimeout(() => settle(/* @__PURE__ */ new Error(`WebSocket open timed out after ${openTimeoutMs}ms`)), openTimeoutMs);
1360
- openTimer.unref?.();
1361
- ws.on("open", onOpen);
1362
- ws.on("message", onMessage);
1363
- ws.on("close", onClose);
1364
- ws.on("error", onError);
1365
- abortSignal.addEventListener("abort", onAbort, { once: true });
1366
- });
1367
- }
1368
- async function openBridgeWebSocket({ endpoint, timeoutMs, abortSignal, onHello }) {
1369
- const deadline = Date.now() + timeoutMs;
1370
- let attempt = 0;
1371
- let lastError;
1372
- while (!abortSignal.aborted && Date.now() < deadline) {
1373
- attempt++;
1374
- try {
1375
- const remaining = Math.max(1, deadline - Date.now());
1376
- return await openWebSocketAndWaitForBridgeHello({
1377
- endpoint,
1378
- openTimeoutMs: Math.min(1e4, remaining),
1379
- getHelloTimeoutMs: () => Math.min(5e3, Math.max(1, deadline - Date.now())),
1380
- abortSignal,
1381
- onHello
1382
- });
1383
- } catch (err) {
1384
- if (abortSignal.aborted) throw abortSignal.reason ?? /* @__PURE__ */ new Error("WebSocket connection aborted");
1385
- lastError = err;
1386
- const remaining = deadline - Date.now();
1387
- if (remaining <= 0) break;
1388
- await sleep({
1389
- ms: Math.min(250 * attempt, 1e3, remaining),
1390
- abortSignal
1391
- });
1392
- }
1393
- }
1394
- if (abortSignal.aborted) throw abortSignal.reason ?? /* @__PURE__ */ new Error("WebSocket connection aborted");
1395
- throw new Error(`claude-code bridge did not complete WebSocket handshake within ${timeoutMs}ms after ${attempt} attempt(s). Last error: ${formatUnknownError(lastError)}`);
1396
- }
1397
- function webSocketMessageToString(raw) {
1398
- if (typeof raw === "string") return raw;
1399
- if (Buffer.isBuffer(raw)) return raw.toString("utf8");
1400
- if (Array.isArray(raw)) return Buffer.concat(raw).toString("utf8");
1401
- if (raw instanceof ArrayBuffer) return Buffer.from(raw).toString("utf8");
1402
- if (ArrayBuffer.isView(raw)) return Buffer.from(raw.buffer, raw.byteOffset, raw.byteLength).toString("utf8");
1403
- return String(raw);
1404
- }
1405
- function formatUnknownError(error) {
1406
- if (error instanceof Error) return error.message;
1407
- return String(error);
1408
- }
1409
1237
  function createSession({ sessionId, channel, finishListenerAttachment, proc, maxTurns, agentProgressSummaries, forwardSubagentText, env, thinking, effort, isResume, continueOnFirstPrompt, resumeSessionId, rerunContinue, bridgePort, bridgeToken, sandboxId, sandboxCredentialEnvironment, debug, permissionMode, builtinToolFiltering, sandbox, sandboxHomeDir, mcpServers, supportsUserMessageResponses }) {
1410
1238
  let stopped = false;
1411
1239
  let stopPromise;