pi-better-harness 0.59.1 → 0.59.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/CHANGELOG.md +7 -0
- package/node_modules/pi-better-background-tasks/runtime-client/artifacts/darwin-arm64.gz +0 -0
- package/node_modules/pi-better-background-tasks/runtime-client/artifacts/darwin-arm64.json +1 -1
- package/node_modules/pi-better-background-tasks/runtime-client/artifacts/darwin-x64.gz +0 -0
- package/node_modules/pi-better-background-tasks/runtime-client/artifacts/darwin-x64.json +1 -1
- package/node_modules/pi-better-background-tasks/runtime-client/artifacts/linux-arm64.gz +0 -0
- package/node_modules/pi-better-background-tasks/runtime-client/artifacts/linux-arm64.json +1 -1
- package/node_modules/pi-better-background-tasks/runtime-client/artifacts/linux-x64.gz +0 -0
- package/node_modules/pi-better-background-tasks/runtime-client/artifacts/linux-x64.json +1 -1
- package/node_modules/pi-better-background-tasks/runtime-client/src/runtime/work-client.mjs +12 -3
- package/node_modules/pi-better-background-tasks/src/shared-work-client.mjs +12 -3
- package/node_modules/pi-better-subagents/package.json +2 -0
- package/node_modules/pi-better-subagents/registry.ts +2 -0
- package/node_modules/pi-better-subagents/runtime-client/artifacts/darwin-arm64.gz +0 -0
- package/node_modules/pi-better-subagents/runtime-client/artifacts/darwin-arm64.json +1 -1
- package/node_modules/pi-better-subagents/runtime-client/artifacts/darwin-x64.gz +0 -0
- package/node_modules/pi-better-subagents/runtime-client/artifacts/darwin-x64.json +1 -1
- package/node_modules/pi-better-subagents/runtime-client/artifacts/linux-arm64.gz +0 -0
- package/node_modules/pi-better-subagents/runtime-client/artifacts/linux-arm64.json +1 -1
- package/node_modules/pi-better-subagents/runtime-client/artifacts/linux-x64.gz +0 -0
- package/node_modules/pi-better-subagents/runtime-client/artifacts/linux-x64.json +1 -1
- package/node_modules/pi-better-subagents/runtime-client/src/runtime/work-client.mjs +12 -3
- package/node_modules/pi-better-subagents/shared-work-client.mjs +12 -3
- package/node_modules/pi-better-subagents/work-observation.ts +7 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.59.2] - 2026-11-28
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- The bundled runtime recovers when a task archive changes during snapshot verification, even if the file watcher reports only the live task record.
|
|
8
|
+
- The subagent task view reconnects if its initial subscription times out.
|
|
9
|
+
|
|
3
10
|
## [0.59.1] - 2026-11-27
|
|
4
11
|
|
|
5
12
|
### Fixed
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"build":{"format":1,"sourceDigest":"
|
|
1
|
+
{"build":{"format":1,"sourceDigest":"631adb326db77f35634be50741dac5e76654300f8300ab06bba26ca7933debed","piSdkVersion":"1.6.1","nodeVersion":"24.14.1","platform":"darwin-arm64","dependencyLockDigest":"4b8b42f3d091ddf390547a02a1b71031543baab877d8cf5fd3241179b85e9554","protocolVersion":1,"serverVersion":"0.8.5","contentId":"f7fc76580596e35cfcba5dd98d62c81d4b29ae92eb247d1a54c56ee76e745397"},"sha256":"27de1234e8628fc61063f6fc160befadb0d157f18cb0d182ce6c06f0155825be"}
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"build":{"format":1,"sourceDigest":"
|
|
1
|
+
{"build":{"format":1,"sourceDigest":"631adb326db77f35634be50741dac5e76654300f8300ab06bba26ca7933debed","piSdkVersion":"1.6.1","nodeVersion":"24.14.1","platform":"darwin-x64","dependencyLockDigest":"4b8b42f3d091ddf390547a02a1b71031543baab877d8cf5fd3241179b85e9554","protocolVersion":1,"serverVersion":"0.8.5","contentId":"30608dc6d48179221e6d725228ef015d4ba9f57ba2d0ba949bd16f451157ae4b"},"sha256":"87f4407983446fae701ad4fef1ecd95597ba1950b114b2bc1ce45e6c0c616216"}
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"build":{"format":1,"sourceDigest":"
|
|
1
|
+
{"build":{"format":1,"sourceDigest":"631adb326db77f35634be50741dac5e76654300f8300ab06bba26ca7933debed","piSdkVersion":"1.6.1","nodeVersion":"24.14.1","platform":"linux-arm64","dependencyLockDigest":"4b8b42f3d091ddf390547a02a1b71031543baab877d8cf5fd3241179b85e9554","protocolVersion":1,"serverVersion":"0.8.5","contentId":"76f10f923bfe26156b39585bec8a4826ae62dc793bd16fee6322584ab9eb72e3"},"sha256":"b772d4fca8849e79eaea41868ad602b36daa6087ce1a9bb30d036bb44c276129"}
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"build":{"format":1,"sourceDigest":"
|
|
1
|
+
{"build":{"format":1,"sourceDigest":"631adb326db77f35634be50741dac5e76654300f8300ab06bba26ca7933debed","piSdkVersion":"1.6.1","nodeVersion":"24.14.1","platform":"linux-x64","dependencyLockDigest":"4b8b42f3d091ddf390547a02a1b71031543baab877d8cf5fd3241179b85e9554","protocolVersion":1,"serverVersion":"0.8.5","contentId":"e0f9da740f48ea7459380f1979f318ae4748479fec3315b2bdb41dc31e4e65ef"},"sha256":"2f15804cf057b6ce3644689c2e884ded6245dd15fd413fc79af92eebb930aa27"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
2
3
|
import { connect } from "node:net";
|
|
3
4
|
import { performance } from "node:perf_hooks";
|
|
4
5
|
import { setTimeout as delay } from "node:timers/promises";
|
|
@@ -19,6 +20,7 @@ function unknownLaunchReceipt(cause) {
|
|
|
19
20
|
|
|
20
21
|
/** SDK-free observation stream. Cached snapshots are the only synchronous read API. */
|
|
21
22
|
export class WorkClient {
|
|
23
|
+
lastSubscriptionTrace;
|
|
22
24
|
socket;
|
|
23
25
|
snapshot;
|
|
24
26
|
pending = new Map();
|
|
@@ -72,21 +74,28 @@ export class WorkClient {
|
|
|
72
74
|
request(type, params = {}) {
|
|
73
75
|
if (this.closed) return Promise.reject(new Error("runtime-unavailable: disconnected; resync required"));
|
|
74
76
|
if (this.pending.size >= 32) return Promise.reject(new Error("runtime-unhealthy: too many in-flight queries"));
|
|
75
|
-
const
|
|
77
|
+
const trace = type === "runtime_subscribe" ? { id: `sub-${randomUUID()}`, sentAt: Date.now() } : undefined;
|
|
78
|
+
if (trace) this.lastSubscriptionTrace = trace;
|
|
79
|
+
const id = trace?.id ?? `work-${++this.sequence}`;
|
|
76
80
|
return new Promise((resolve, reject) => {
|
|
77
81
|
const rejectPending = type === "runtime_launch_subagent" ? error => reject(unknownLaunchReceipt(error)) : reject;
|
|
78
82
|
const timer = setTimeout(() => {
|
|
79
83
|
this.pending.delete(id);
|
|
80
|
-
|
|
84
|
+
if (trace) trace.timedOutAt = Date.now();
|
|
85
|
+
rejectPending(new Error(`runtime-unhealthy: ${type} timed out${trace ? ` (${trace.id})` : ""}`));
|
|
81
86
|
}, 5000);
|
|
82
87
|
this.pending.set(id, { resolve: value => {
|
|
88
|
+
if (trace) trace.receivedAt = Date.now();
|
|
83
89
|
// Apply subscription receipts in wire order, including events in the same socket chunk.
|
|
84
90
|
try {
|
|
85
91
|
if (type === "runtime_subscribe" && Number.isSafeInteger(params.subscriptionGeneration))
|
|
86
92
|
this.accept(value, undefined, params.subscriptionGeneration);
|
|
87
93
|
resolve(value);
|
|
88
94
|
} catch (error) { reject(error); }
|
|
89
|
-
}, reject
|
|
95
|
+
}, reject: error => {
|
|
96
|
+
if (trace) trace.receivedAt = Date.now();
|
|
97
|
+
reject(error);
|
|
98
|
+
}, rejectPending, timer });
|
|
90
99
|
this.socket.write(JSON.stringify({ id, type, ...params }) + "\n");
|
|
91
100
|
});
|
|
92
101
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
2
3
|
import { connect } from "node:net";
|
|
3
4
|
import { performance } from "node:perf_hooks";
|
|
4
5
|
import { setTimeout as delay } from "node:timers/promises";
|
|
@@ -19,6 +20,7 @@ function unknownLaunchReceipt(cause) {
|
|
|
19
20
|
|
|
20
21
|
/** SDK-free observation stream. Cached snapshots are the only synchronous read API. */
|
|
21
22
|
export class WorkClient {
|
|
23
|
+
lastSubscriptionTrace;
|
|
22
24
|
socket;
|
|
23
25
|
snapshot;
|
|
24
26
|
pending = new Map();
|
|
@@ -72,21 +74,28 @@ export class WorkClient {
|
|
|
72
74
|
request(type, params = {}) {
|
|
73
75
|
if (this.closed) return Promise.reject(new Error("runtime-unavailable: disconnected; resync required"));
|
|
74
76
|
if (this.pending.size >= 32) return Promise.reject(new Error("runtime-unhealthy: too many in-flight queries"));
|
|
75
|
-
const
|
|
77
|
+
const trace = type === "runtime_subscribe" ? { id: `sub-${randomUUID()}`, sentAt: Date.now() } : undefined;
|
|
78
|
+
if (trace) this.lastSubscriptionTrace = trace;
|
|
79
|
+
const id = trace?.id ?? `work-${++this.sequence}`;
|
|
76
80
|
return new Promise((resolve, reject) => {
|
|
77
81
|
const rejectPending = type === "runtime_launch_subagent" ? error => reject(unknownLaunchReceipt(error)) : reject;
|
|
78
82
|
const timer = setTimeout(() => {
|
|
79
83
|
this.pending.delete(id);
|
|
80
|
-
|
|
84
|
+
if (trace) trace.timedOutAt = Date.now();
|
|
85
|
+
rejectPending(new Error(`runtime-unhealthy: ${type} timed out${trace ? ` (${trace.id})` : ""}`));
|
|
81
86
|
}, 5000);
|
|
82
87
|
this.pending.set(id, { resolve: value => {
|
|
88
|
+
if (trace) trace.receivedAt = Date.now();
|
|
83
89
|
// Apply subscription receipts in wire order, including events in the same socket chunk.
|
|
84
90
|
try {
|
|
85
91
|
if (type === "runtime_subscribe" && Number.isSafeInteger(params.subscriptionGeneration))
|
|
86
92
|
this.accept(value, undefined, params.subscriptionGeneration);
|
|
87
93
|
resolve(value);
|
|
88
94
|
} catch (error) { reject(error); }
|
|
89
|
-
}, reject
|
|
95
|
+
}, reject: error => {
|
|
96
|
+
if (trace) trace.receivedAt = Date.now();
|
|
97
|
+
reject(error);
|
|
98
|
+
}, rejectPending, timer });
|
|
90
99
|
this.socket.write(JSON.stringify({ id, type, ...params }) + "\n");
|
|
91
100
|
});
|
|
92
101
|
}
|
|
@@ -46,6 +46,8 @@
|
|
|
46
46
|
"prepack": "node ../../scripts/sync-shared-log-utils.mjs && node ../../scripts/sync-shared-sandbox-core.mjs && node ../../scripts/sync-task-sandbox.mjs && node ../../scripts/sync-runtime-client.mjs",
|
|
47
47
|
"typecheck": "tsc -p tsconfig.task-runtime.json",
|
|
48
48
|
"test": "node --import tsx --import ./tests/isolate-registry.mjs --test tests/*.test.mjs",
|
|
49
|
+
"pretest:shard": "npm run pretest",
|
|
50
|
+
"test:shard": "node --import tsx --import ./tests/isolate-registry.mjs --test",
|
|
49
51
|
"test:cross-session": "node --import tsx --import ./tests/isolate-registry.mjs --test --test-name-pattern \"callback session isolation\" tests/extension_health_lifecycle.test.mjs",
|
|
50
52
|
"pretest:macos-sandbox": "node ../../scripts/sync-shared-sandbox-core.mjs",
|
|
51
53
|
"test:macos-sandbox": "bash tests/test_sandbox_applied.sh && bash tests/test_sandbox_deny_outside.sh && bash tests/test_sandbox_wrapper_argv.sh && PI_SANDBOX_RECOVERY_SNAPSHOT=off node --import tsx --test tests/sandbox_profile.test.mjs tests/child_incidents.test.mjs",
|
|
@@ -24,6 +24,7 @@ import { createHash, randomBytes } from "node:crypto";
|
|
|
24
24
|
import { closeSync, existsSync, fsyncSync, linkSync, mkdirSync, openSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
25
25
|
import { createRequire } from "node:module";
|
|
26
26
|
import { readFile, readdir } from "node:fs/promises";
|
|
27
|
+
import { setImmediate as yieldToIO } from "node:timers/promises";
|
|
27
28
|
import { tmpdir } from "node:os";
|
|
28
29
|
import { basename, dirname, join } from "node:path";
|
|
29
30
|
import { processExists } from "./spawn.ts";
|
|
@@ -575,6 +576,7 @@ export async function* scanParkRecords(
|
|
|
575
576
|
if (record && (!include || include(record))) return { meta, record };
|
|
576
577
|
}));
|
|
577
578
|
for (const entry of batch) if (entry) yield entry;
|
|
579
|
+
if (offset + batchSize < metas.length) await yieldToIO();
|
|
578
580
|
}
|
|
579
581
|
}
|
|
580
582
|
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"build":{"format":1,"sourceDigest":"
|
|
1
|
+
{"build":{"format":1,"sourceDigest":"631adb326db77f35634be50741dac5e76654300f8300ab06bba26ca7933debed","piSdkVersion":"1.6.1","nodeVersion":"24.14.1","platform":"darwin-arm64","dependencyLockDigest":"4b8b42f3d091ddf390547a02a1b71031543baab877d8cf5fd3241179b85e9554","protocolVersion":1,"serverVersion":"0.8.5","contentId":"f7fc76580596e35cfcba5dd98d62c81d4b29ae92eb247d1a54c56ee76e745397"},"sha256":"27de1234e8628fc61063f6fc160befadb0d157f18cb0d182ce6c06f0155825be"}
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"build":{"format":1,"sourceDigest":"
|
|
1
|
+
{"build":{"format":1,"sourceDigest":"631adb326db77f35634be50741dac5e76654300f8300ab06bba26ca7933debed","piSdkVersion":"1.6.1","nodeVersion":"24.14.1","platform":"darwin-x64","dependencyLockDigest":"4b8b42f3d091ddf390547a02a1b71031543baab877d8cf5fd3241179b85e9554","protocolVersion":1,"serverVersion":"0.8.5","contentId":"30608dc6d48179221e6d725228ef015d4ba9f57ba2d0ba949bd16f451157ae4b"},"sha256":"87f4407983446fae701ad4fef1ecd95597ba1950b114b2bc1ce45e6c0c616216"}
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"build":{"format":1,"sourceDigest":"
|
|
1
|
+
{"build":{"format":1,"sourceDigest":"631adb326db77f35634be50741dac5e76654300f8300ab06bba26ca7933debed","piSdkVersion":"1.6.1","nodeVersion":"24.14.1","platform":"linux-arm64","dependencyLockDigest":"4b8b42f3d091ddf390547a02a1b71031543baab877d8cf5fd3241179b85e9554","protocolVersion":1,"serverVersion":"0.8.5","contentId":"76f10f923bfe26156b39585bec8a4826ae62dc793bd16fee6322584ab9eb72e3"},"sha256":"b772d4fca8849e79eaea41868ad602b36daa6087ce1a9bb30d036bb44c276129"}
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"build":{"format":1,"sourceDigest":"
|
|
1
|
+
{"build":{"format":1,"sourceDigest":"631adb326db77f35634be50741dac5e76654300f8300ab06bba26ca7933debed","piSdkVersion":"1.6.1","nodeVersion":"24.14.1","platform":"linux-x64","dependencyLockDigest":"4b8b42f3d091ddf390547a02a1b71031543baab877d8cf5fd3241179b85e9554","protocolVersion":1,"serverVersion":"0.8.5","contentId":"e0f9da740f48ea7459380f1979f318ae4748479fec3315b2bdb41dc31e4e65ef"},"sha256":"2f15804cf057b6ce3644689c2e884ded6245dd15fd413fc79af92eebb930aa27"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
2
3
|
import { connect } from "node:net";
|
|
3
4
|
import { performance } from "node:perf_hooks";
|
|
4
5
|
import { setTimeout as delay } from "node:timers/promises";
|
|
@@ -19,6 +20,7 @@ function unknownLaunchReceipt(cause) {
|
|
|
19
20
|
|
|
20
21
|
/** SDK-free observation stream. Cached snapshots are the only synchronous read API. */
|
|
21
22
|
export class WorkClient {
|
|
23
|
+
lastSubscriptionTrace;
|
|
22
24
|
socket;
|
|
23
25
|
snapshot;
|
|
24
26
|
pending = new Map();
|
|
@@ -72,21 +74,28 @@ export class WorkClient {
|
|
|
72
74
|
request(type, params = {}) {
|
|
73
75
|
if (this.closed) return Promise.reject(new Error("runtime-unavailable: disconnected; resync required"));
|
|
74
76
|
if (this.pending.size >= 32) return Promise.reject(new Error("runtime-unhealthy: too many in-flight queries"));
|
|
75
|
-
const
|
|
77
|
+
const trace = type === "runtime_subscribe" ? { id: `sub-${randomUUID()}`, sentAt: Date.now() } : undefined;
|
|
78
|
+
if (trace) this.lastSubscriptionTrace = trace;
|
|
79
|
+
const id = trace?.id ?? `work-${++this.sequence}`;
|
|
76
80
|
return new Promise((resolve, reject) => {
|
|
77
81
|
const rejectPending = type === "runtime_launch_subagent" ? error => reject(unknownLaunchReceipt(error)) : reject;
|
|
78
82
|
const timer = setTimeout(() => {
|
|
79
83
|
this.pending.delete(id);
|
|
80
|
-
|
|
84
|
+
if (trace) trace.timedOutAt = Date.now();
|
|
85
|
+
rejectPending(new Error(`runtime-unhealthy: ${type} timed out${trace ? ` (${trace.id})` : ""}`));
|
|
81
86
|
}, 5000);
|
|
82
87
|
this.pending.set(id, { resolve: value => {
|
|
88
|
+
if (trace) trace.receivedAt = Date.now();
|
|
83
89
|
// Apply subscription receipts in wire order, including events in the same socket chunk.
|
|
84
90
|
try {
|
|
85
91
|
if (type === "runtime_subscribe" && Number.isSafeInteger(params.subscriptionGeneration))
|
|
86
92
|
this.accept(value, undefined, params.subscriptionGeneration);
|
|
87
93
|
resolve(value);
|
|
88
94
|
} catch (error) { reject(error); }
|
|
89
|
-
}, reject
|
|
95
|
+
}, reject: error => {
|
|
96
|
+
if (trace) trace.receivedAt = Date.now();
|
|
97
|
+
reject(error);
|
|
98
|
+
}, rejectPending, timer });
|
|
90
99
|
this.socket.write(JSON.stringify({ id, type, ...params }) + "\n");
|
|
91
100
|
});
|
|
92
101
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
2
3
|
import { connect } from "node:net";
|
|
3
4
|
import { performance } from "node:perf_hooks";
|
|
4
5
|
import { setTimeout as delay } from "node:timers/promises";
|
|
@@ -19,6 +20,7 @@ function unknownLaunchReceipt(cause) {
|
|
|
19
20
|
|
|
20
21
|
/** SDK-free observation stream. Cached snapshots are the only synchronous read API. */
|
|
21
22
|
export class WorkClient {
|
|
23
|
+
lastSubscriptionTrace;
|
|
22
24
|
socket;
|
|
23
25
|
snapshot;
|
|
24
26
|
pending = new Map();
|
|
@@ -72,21 +74,28 @@ export class WorkClient {
|
|
|
72
74
|
request(type, params = {}) {
|
|
73
75
|
if (this.closed) return Promise.reject(new Error("runtime-unavailable: disconnected; resync required"));
|
|
74
76
|
if (this.pending.size >= 32) return Promise.reject(new Error("runtime-unhealthy: too many in-flight queries"));
|
|
75
|
-
const
|
|
77
|
+
const trace = type === "runtime_subscribe" ? { id: `sub-${randomUUID()}`, sentAt: Date.now() } : undefined;
|
|
78
|
+
if (trace) this.lastSubscriptionTrace = trace;
|
|
79
|
+
const id = trace?.id ?? `work-${++this.sequence}`;
|
|
76
80
|
return new Promise((resolve, reject) => {
|
|
77
81
|
const rejectPending = type === "runtime_launch_subagent" ? error => reject(unknownLaunchReceipt(error)) : reject;
|
|
78
82
|
const timer = setTimeout(() => {
|
|
79
83
|
this.pending.delete(id);
|
|
80
|
-
|
|
84
|
+
if (trace) trace.timedOutAt = Date.now();
|
|
85
|
+
rejectPending(new Error(`runtime-unhealthy: ${type} timed out${trace ? ` (${trace.id})` : ""}`));
|
|
81
86
|
}, 5000);
|
|
82
87
|
this.pending.set(id, { resolve: value => {
|
|
88
|
+
if (trace) trace.receivedAt = Date.now();
|
|
83
89
|
// Apply subscription receipts in wire order, including events in the same socket chunk.
|
|
84
90
|
try {
|
|
85
91
|
if (type === "runtime_subscribe" && Number.isSafeInteger(params.subscriptionGeneration))
|
|
86
92
|
this.accept(value, undefined, params.subscriptionGeneration);
|
|
87
93
|
resolve(value);
|
|
88
94
|
} catch (error) { reject(error); }
|
|
89
|
-
}, reject
|
|
95
|
+
}, reject: error => {
|
|
96
|
+
if (trace) trace.receivedAt = Date.now();
|
|
97
|
+
reject(error);
|
|
98
|
+
}, rejectPending, timer });
|
|
90
99
|
this.socket.write(JSON.stringify({ id, type, ...params }) + "\n");
|
|
91
100
|
});
|
|
92
101
|
}
|
|
@@ -174,7 +174,13 @@ async function connectObservation(current: number) {
|
|
|
174
174
|
reconnectLater(current);
|
|
175
175
|
} else void collect(candidate, current).catch(error => { if (current === generation) degraded(error); });
|
|
176
176
|
});
|
|
177
|
-
|
|
177
|
+
try {
|
|
178
|
+
await candidate.subscribe({ ...saved.origin, limit: 200 });
|
|
179
|
+
} catch (error) {
|
|
180
|
+
if (client === candidate) client = undefined;
|
|
181
|
+
candidate.close();
|
|
182
|
+
throw error;
|
|
183
|
+
}
|
|
178
184
|
if (candidate.snapshot?.status === "rebuilding") await new Promise<void>((resolve, reject) => {
|
|
179
185
|
const timer = setTimeout(() => { stop(); reject(new Error("Runtime scope is still rebuilding; retry the observation.")); }, 5000);
|
|
180
186
|
const stop = candidate.onChange(value => {
|