@parall/daemon 1.63.0 → 1.64.0
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/bundle/manifest.json +11 -11
- package/bundle/parall-browser-pod.js +97 -97
- package/bundle/parall-claude-agent.js +863 -319
- package/bundle/parall-codex-agent.js +815 -302
- package/bundle/parall-daemon.js +626 -169
- package/dist/config.d.ts +5 -5
- package/dist/daemon-telemetry.d.ts +1 -1
- package/dist/daemon-telemetry.d.ts.map +1 -1
- package/dist/supervisor.d.ts.map +1 -1
- package/dist/supervisor.js +95 -10
- package/dist/update-health-gate.d.ts +18 -14
- package/dist/update-health-gate.d.ts.map +1 -1
- package/dist/update-health-gate.js +18 -14
- package/dist/updater.d.ts.map +1 -1
- package/dist/updater.js +5 -9
- package/package.json +6 -6
package/dist/config.d.ts
CHANGED
|
@@ -54,11 +54,11 @@ export type ClaudeDaemonConfig = {
|
|
|
54
54
|
/** Disable self-update entirely (K8s env auto-disables). */
|
|
55
55
|
updateDisabled: boolean;
|
|
56
56
|
/**
|
|
57
|
-
* Stability window for the update canary (PendingUpdateHealthGate):
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* 60s; 0 = confirm
|
|
57
|
+
* Stability window for the update canary (PendingUpdateHealthGate): a freshly
|
|
58
|
+
* self-updated version must stay up this long after its supervisor starts
|
|
59
|
+
* before it is confirmed healthy and rollback protection clears — no server
|
|
60
|
+
* contact is required. Until then a process-level unclean exit still rolls
|
|
61
|
+
* back. Default 60s; 0 = confirm as soon as the supervisor starts.
|
|
62
62
|
*/
|
|
63
63
|
updateConfirmDelayMs: number;
|
|
64
64
|
/**
|
|
@@ -7,7 +7,7 @@ import type { GatewayLogger } from '@parall/agent-core';
|
|
|
7
7
|
*/
|
|
8
8
|
export type ChildExitKind = 'clean' | 'crash' | 'signal' | 'spawn_error';
|
|
9
9
|
export type UpdateOutcome = 'applied' | 'failed' | 'skipped' | 'rolled_back' | 'confirmed';
|
|
10
|
-
export type UpdateReason = '
|
|
10
|
+
export type UpdateReason = 'previously_rolled_back' | 'node_version' | 'node_version_invalid' | 'manifest_fetch' | 'manifest_parse' | 'signing_key_missing' | 'signature' | 'download' | 'sha256_mismatch' | 'size_mismatch' | 'exception' | 'boot_threshold';
|
|
11
11
|
export type ClockGapKind = 'sleep' | 'stall';
|
|
12
12
|
/** Which proxy variables are set — names only; the values are never logged. */
|
|
13
13
|
export declare function proxyEnvNames(env: NodeJS.ProcessEnv): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daemon-telemetry.d.ts","sourceRoot":"","sources":["../src/daemon-telemetry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,KAAK,EAAW,MAAM,oBAAoB,CAAC;AACvF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD;;;;GAIG;AAEH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,aAAa,CAAC;AACzE,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,aAAa,GAAG,WAAW,CAAC;AAC3F,MAAM,MAAM,YAAY,GACpB,
|
|
1
|
+
{"version":3,"file":"daemon-telemetry.d.ts","sourceRoot":"","sources":["../src/daemon-telemetry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,KAAK,KAAK,EAAW,MAAM,oBAAoB,CAAC;AACvF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD;;;;GAIG;AAEH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,aAAa,CAAC;AACzE,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,aAAa,GAAG,WAAW,CAAC;AAC3F,MAAM,MAAM,YAAY,GACpB,wBAAwB,GACxB,cAAc,GACd,sBAAsB,GACtB,gB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@@
|
|
|
1
|
-
{"version":3,"file":"supervisor.d.ts","sourceRoot":"","sources":["../src/supervisor.ts"],"names":[],"mappings":"AAmBA,OAAO,
|
|
1
|
+
{"version":3,"file":"supervisor.d.ts","sourceRoot":"","sources":["../src/supervisor.ts"],"names":[],"mappings":"AAmBA,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAiBL,KAAK,YAAY,EAElB,MAAM,aAAa,CAAC;AAIrB,OAAO,EAAE,KAAK,eAAe,EAAyC,MAAM,uBAAuB,CAAC;AAUpG,OAAO,EAKL,KAAK,kBAAkB,EACxB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,KAAK,4BAA4B,EAElC,MAAM,4BAA4B,CAAC;AAepC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAwBvE;;;;GAIG;AACH,iBAAS,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,CAa3E;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC;AA4B5B;;;;;;;;;;GAUG;AACH,qBAAa,gBAAgB;IAqGzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAtGtB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAiC;IAC1D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAqB;IACpD,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAqB;IAM3D,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAoC;IAM3E,OAAO,CAAC,QAAQ,CAAC,4BAA4B,CAA6B;IAC1E,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAqC;IAC/E,OAAO,CAAC,QAAQ,CAAC,6BAA6B,CA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AwClC;;;;;;;OAOG;IACH,OAAO,CAAC,qBAAqB;IAQ7B;;;;;;OAMG;IACH,OAAO,CAAC,YAAY;IASpB;;;;;;;;OAQG;YACW,sBAAsB;YA4CtB,kBAAkB;IAahC;;;;;;;;;OASG;YACW,wBAAwB;IAwDtC;;;;;;;OAOG;YACW,qBAAqB;IAcnC,OAAO,CAAC,+BAA+B;IAYvC,OAAO,CAAC,4BAA4B;YAQtB,eAAe;YAiEf,UAAU;IA+BxB;;;;;;OAMG;IACH,OAAO,CAAC,sBAAsB;YAgBhB,cAAc;IAsE5B,OAAO,CAAC,UAAU;IA+NlB;;;;;OAKG;YACW,cAAc;CAwB7B"}
|
package/dist/supervisor.js
CHANGED
|
@@ -4,8 +4,8 @@ import { LAUNCH_FAILED_ATTEMPTS, LAUNCH_REPLAY_INTERVAL_MS, LaunchStateReporter,
|
|
|
4
4
|
import * as fs from 'node:fs';
|
|
5
5
|
import * as os from 'node:os';
|
|
6
6
|
import * as path from 'node:path';
|
|
7
|
-
import { effectiveLLMSourceExplicit, llmSource } from '@parall/agent-core';
|
|
8
|
-
import { describeWsStateDetail, ParallWs, } from '@parall/sdk';
|
|
7
|
+
import { AUTH_INVALID_EXIT_CODE, effectiveLLMSourceExplicit, llmSource, } from '@parall/agent-core';
|
|
8
|
+
import { describeWsStateDetail, ParallWs, ApiError, } from '@parall/sdk';
|
|
9
9
|
import { reconcileBrowserProfiles as runBrowserProfileReconcile } from './browser-profile-reconcile.js';
|
|
10
10
|
import { handleBrowserProfileViewerCommand } from './browser-profile-viewer-control.js';
|
|
11
11
|
import { PUBLIC_PROXY_PROBE_FALLBACK_URL } from './clip-runtime/browser-readiness.js';
|
|
@@ -28,6 +28,8 @@ const RUNTIME_PACKAGES = {
|
|
|
28
28
|
openclaw: '@parall/openclaw-agent',
|
|
29
29
|
};
|
|
30
30
|
const WORKSPACE_SETUP_RETRY_DELAY_MS = 5_000;
|
|
31
|
+
/** Idle interval that keeps a machine-key-rejected (parked) daemon on the event loop. */
|
|
32
|
+
const PARK_KEEPALIVE_MS = 60_000;
|
|
31
33
|
const AGENT_CONFIG_REFRESH_RETRY_DELAY_MS = 5_000;
|
|
32
34
|
const CLIP_RECONCILE_INTERVAL_MS = 5 * 60_000;
|
|
33
35
|
// Runtime-CLI re-detection cadence. Cheap (three --version probes at most) and
|
|
@@ -189,6 +191,10 @@ export class DaemonSupervisor {
|
|
|
189
191
|
if (this.running)
|
|
190
192
|
throw new Error('supervisor already running');
|
|
191
193
|
this.running = true;
|
|
194
|
+
// Process-stability fact for the update canary: the window starts when this
|
|
195
|
+
// supervisor instance starts, before any server contact, so a version is
|
|
196
|
+
// confirmed by staying up — not by authenticating.
|
|
197
|
+
this.healthGate?.onSupervisorStarted();
|
|
192
198
|
const onAbort = () => {
|
|
193
199
|
this.stop().catch((err) => this.log.error(`stop() failed: ${String(err)}`));
|
|
194
200
|
};
|
|
@@ -197,12 +203,17 @@ export class DaemonSupervisor {
|
|
|
197
203
|
if (!(await this.bootstrapWithRetry(signal))) {
|
|
198
204
|
signal.removeEventListener('abort', onAbort);
|
|
199
205
|
this.running = false;
|
|
206
|
+
// This instance ends before stop() would ever run (stop() is a no-op
|
|
207
|
+
// once running=false), so pair the start signal here: the canary
|
|
208
|
+
// window must not survive into the next supervisor instance.
|
|
209
|
+
this.healthGate?.onSupervisorEnded();
|
|
200
210
|
return;
|
|
201
211
|
}
|
|
202
212
|
}
|
|
203
213
|
catch (err) {
|
|
204
214
|
signal.removeEventListener('abort', onAbort);
|
|
205
215
|
this.running = false;
|
|
216
|
+
this.healthGate?.onSupervisorEnded();
|
|
206
217
|
throw err;
|
|
207
218
|
}
|
|
208
219
|
this.migrateFlatLayout();
|
|
@@ -285,9 +296,6 @@ export class DaemonSupervisor {
|
|
|
285
296
|
this.log.info(`machine WS connected (machine.hello)${skewMs === null ? '' : ` skew=${skewMs}ms`}`);
|
|
286
297
|
if (skewMs !== null)
|
|
287
298
|
this.daemonTelemetry?.recordClockSkew(skewMs);
|
|
288
|
-
// Control-plane handshake fact — the health gate (process-level) owns the
|
|
289
|
-
// confirm / stability-window policy; the supervisor just reports the event.
|
|
290
|
-
this.healthGate?.onMachineHello();
|
|
291
299
|
// Reconnect replay (§4.6): reports sent while the control plane was
|
|
292
300
|
// unreachable may have been lost — resend every current launch state.
|
|
293
301
|
void this.launch.replayAll();
|
|
@@ -365,13 +373,25 @@ export class DaemonSupervisor {
|
|
|
365
373
|
void this.enqueueBrowserProfileOp(data.profile_id, () => handleBrowserProfileViewerCommand({ pool: this.browserProfilePool, client: this.client, log: this.log }, data));
|
|
366
374
|
});
|
|
367
375
|
this.ws.onStateChange((state, detail) => {
|
|
368
|
-
if (state === 'disconnected' || state === 'reconnecting') {
|
|
376
|
+
if (state === 'disconnected' || state === 'reconnecting' || state === 'auth-invalid') {
|
|
369
377
|
this.log.warn(`machine WS state: ${state}${describeWsStateDetail(detail)}`);
|
|
370
378
|
}
|
|
371
379
|
if (state === 'reconnecting') {
|
|
372
380
|
this.daemonTelemetry?.recordWsReconnect({ cause: detail?.cause, closeCode: detail?.code });
|
|
373
381
|
}
|
|
374
382
|
});
|
|
383
|
+
this.ws.onAuthInvalid((event) => {
|
|
384
|
+
// No automated recovery exists for the machine key: it is issued once
|
|
385
|
+
// at machine registration (config file / env) and there is no refresh
|
|
386
|
+
// flow the daemon can drive itself. Loud and actionable is the best
|
|
387
|
+
// this process can do — the operator must re-register.
|
|
388
|
+
this.log.error(`machine WS auth-invalid: the server rejected this machine's key ` +
|
|
389
|
+
`(status ${event.status}${event.code ? `, code ${event.code}` : ''}) — ` +
|
|
390
|
+
`${event.message}. Control-plane events (attach/detach, config updates, ` +
|
|
391
|
+
'update signals) are OFFLINE and reconnects are stopped. Re-register or ' +
|
|
392
|
+
're-authenticate this machine (Desktop app or `parall-daemon register`) to ' +
|
|
393
|
+
'install a new machine key, then restart the daemon.');
|
|
394
|
+
});
|
|
375
395
|
await this.ws.connect();
|
|
376
396
|
await new Promise((resolve) => {
|
|
377
397
|
this.stopResolve = resolve;
|
|
@@ -460,6 +480,45 @@ export class DaemonSupervisor {
|
|
|
460
480
|
return true;
|
|
461
481
|
}
|
|
462
482
|
catch (err) {
|
|
483
|
+
// A 401 on the machine-key bootstrap is terminal, not transient:
|
|
484
|
+
// retrying the same rejected mck_ cannot succeed and there is no
|
|
485
|
+
// self-serve machine-key refresh flow. Same treatment as the
|
|
486
|
+
// machine-WS auth-invalid state: actionable guidance, no retry loop.
|
|
487
|
+
if (err instanceof ApiError && err.status === 401) {
|
|
488
|
+
this.log.error(`machine key rejected by the server ` +
|
|
489
|
+
`(status 401${err.code ? `, code ${err.code}` : ''}): ${err.message}. ` +
|
|
490
|
+
'The daemon cannot start with this machine key and no automatic recovery exists — ' +
|
|
491
|
+
're-register or re-authenticate this machine (Desktop app or `parall-daemon register`) ' +
|
|
492
|
+
'to install a new machine key, then restart the daemon.');
|
|
493
|
+
// Park instead of exiting: managed installations (launchd KeepAlive,
|
|
494
|
+
// systemd Restart=always) relaunch a normally-exited daemon every
|
|
495
|
+
// few seconds with the same rejected key — a process-level restart
|
|
496
|
+
// loop that recreates the hammering this branch exists to stop. The
|
|
497
|
+
// parked process must therefore hold an ACTIVE handle: a pending
|
|
498
|
+
// Promise with only an abort listener keeps nothing on the event
|
|
499
|
+
// loop, Node exits 0 the moment nothing else is running, and the
|
|
500
|
+
// service manager relaunches it (observed on staging: one boot every
|
|
501
|
+
// ThrottleInterval, 13 rejections a minute). An idle interval is that
|
|
502
|
+
// handle; it does no work and is cleared when the operator sends
|
|
503
|
+
// SIGTERM/SIGINT after re-registering the machine.
|
|
504
|
+
const parked = setInterval(() => { }, PARK_KEEPALIVE_MS);
|
|
505
|
+
try {
|
|
506
|
+
await new Promise((resolve) => {
|
|
507
|
+
// The abort may have landed while getMachineSelf() was still in
|
|
508
|
+
// flight and the 401 raced it here — an addEventListener on an
|
|
509
|
+
// already-aborted signal never fires and would hang shutdown.
|
|
510
|
+
if (signal.aborted) {
|
|
511
|
+
resolve();
|
|
512
|
+
return;
|
|
513
|
+
}
|
|
514
|
+
signal.addEventListener('abort', () => resolve(), { once: true });
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
finally {
|
|
518
|
+
clearInterval(parked);
|
|
519
|
+
}
|
|
520
|
+
return false;
|
|
521
|
+
}
|
|
463
522
|
if (this.config.bootstrapBackoffMs === 0) {
|
|
464
523
|
this.log.error(`getMachineSelf failed: ${String(err)} (fail-fast mode)`);
|
|
465
524
|
throw err;
|
|
@@ -1479,7 +1538,7 @@ export class DaemonSupervisor {
|
|
|
1479
1538
|
this.agentConfigRefreshRetryTimers.delete(agentId);
|
|
1480
1539
|
}
|
|
1481
1540
|
}
|
|
1482
|
-
async restartChildNow(state, reason) {
|
|
1541
|
+
async restartChildNow(state, reason, opts) {
|
|
1483
1542
|
if (!this.running || state.shuttingDown || state.child || state.restartTimer) {
|
|
1484
1543
|
return;
|
|
1485
1544
|
}
|
|
@@ -1495,7 +1554,14 @@ export class DaemonSupervisor {
|
|
|
1495
1554
|
this.restartingStates.add(state);
|
|
1496
1555
|
try {
|
|
1497
1556
|
state.credential = await this.client.mintLaunchCredential(state.agentId);
|
|
1498
|
-
|
|
1557
|
+
// The auth-invalid re-mint path keeps the crash backoff curve: a
|
|
1558
|
+
// credential that keeps being rejected (e.g. agent suspended server-side
|
|
1559
|
+
// right after mint) must not reset to the base delay on every
|
|
1560
|
+
// successful mint and hammer the mint endpoint. The stable-child timer
|
|
1561
|
+
// resets restartAttempts once the re-minted child stays up.
|
|
1562
|
+
if (!opts?.preserveRestartBackoff) {
|
|
1563
|
+
state.restartAttempts = 0;
|
|
1564
|
+
}
|
|
1499
1565
|
this.log.info(`agent ${state.agentId}: restarting child (${reason})`);
|
|
1500
1566
|
this.startChild(state);
|
|
1501
1567
|
}
|
|
@@ -1517,7 +1583,7 @@ export class DaemonSupervisor {
|
|
|
1517
1583
|
this.log.warn(`agent ${state.agentId}: will retry restart in ${delay}ms`);
|
|
1518
1584
|
state.restartTimer = setTimeout(() => {
|
|
1519
1585
|
state.restartTimer = null;
|
|
1520
|
-
void this.restartChildNow(state, reason);
|
|
1586
|
+
void this.restartChildNow(state, reason, opts);
|
|
1521
1587
|
}, delay);
|
|
1522
1588
|
}
|
|
1523
1589
|
void this.launch.update(state.agentId, restartMintFailedReport(err, state.restartAttempts, retrying));
|
|
@@ -1764,6 +1830,12 @@ export class DaemonSupervisor {
|
|
|
1764
1830
|
this.launch.forget(state.agentId);
|
|
1765
1831
|
return;
|
|
1766
1832
|
}
|
|
1833
|
+
const authInvalidExit = event === 'exit' && code === AUTH_INVALID_EXIT_CODE;
|
|
1834
|
+
if (authInvalidExit) {
|
|
1835
|
+
this.log.warn(`agent ${state.agentId}: runtime reports the server rejected its launch credential ` +
|
|
1836
|
+
`(exit ${AUTH_INVALID_EXIT_CODE}) — the key was revoked, rotated, or expired. ` +
|
|
1837
|
+
'A fresh launch credential will be minted before the next start.');
|
|
1838
|
+
}
|
|
1767
1839
|
const delay = Math.min(this.config.restartBackoffMs * 2 ** state.restartAttempts, this.config.restartBackoffMaxMs);
|
|
1768
1840
|
state.restartAttempts += 1;
|
|
1769
1841
|
this.log.warn(`agent ${state.agentId} will restart in ${delay}ms`);
|
|
@@ -1778,7 +1850,20 @@ export class DaemonSupervisor {
|
|
|
1778
1850
|
}));
|
|
1779
1851
|
state.restartTimer = setTimeout(() => {
|
|
1780
1852
|
state.restartTimer = null;
|
|
1781
|
-
|
|
1853
|
+
if (authInvalidExit) {
|
|
1854
|
+
// Re-mint instead of reusing state.credential: a plain startChild
|
|
1855
|
+
// would respawn with the SAME rejected key and loop forever.
|
|
1856
|
+
// Backoff is preserved across the mint (not reset on success) so a
|
|
1857
|
+
// credential that keeps being rejected cannot produce a hot restart
|
|
1858
|
+
// storm; the stable-child timer resets the curve once the agent
|
|
1859
|
+
// stays up.
|
|
1860
|
+
void this.restartChildNow(state, 'credential rejected (auth-invalid exit)', {
|
|
1861
|
+
preserveRestartBackoff: true,
|
|
1862
|
+
});
|
|
1863
|
+
}
|
|
1864
|
+
else {
|
|
1865
|
+
this.startChild(state);
|
|
1866
|
+
}
|
|
1782
1867
|
}, delay);
|
|
1783
1868
|
};
|
|
1784
1869
|
child.once('error', (err) => {
|
|
@@ -12,22 +12,26 @@ type TimerApi = {
|
|
|
12
12
|
* version healthy enough to confirm?" policy in ONE place so it isn't smeared
|
|
13
13
|
* across the supervisor's WS handlers.
|
|
14
14
|
*
|
|
15
|
-
* A pending update is confirmed
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
15
|
+
* A pending update is confirmed by process stability alone: the process +
|
|
16
|
+
* supervisor stay up for `stabilityWindowMs` after the supervisor instance
|
|
17
|
+
* starts, without the supervisor soft-crashing or the process exiting. Nothing
|
|
18
|
+
* about the control plane participates — not the bootstrap, not the WebSocket
|
|
19
|
+
* handshake. A daemon that cannot reach the server (offline, or its machine key
|
|
20
|
+
* rejected) is still a healthy *process*, and rollback exists to catch bundles
|
|
21
|
+
* that crash, not bundles that cannot authenticate; tying confirmation to the
|
|
22
|
+
* server froze such machines on their pending version forever.
|
|
19
23
|
*
|
|
20
24
|
* Lifecycle:
|
|
21
|
-
* - `
|
|
22
|
-
* stability timer. The timer is process-level (lives in this
|
|
23
|
-
* process owns), so it survives WS reconnects; a disconnect
|
|
24
|
-
* it.
|
|
25
|
+
* - `onSupervisorStarted()` — a supervisor instance starting with a pending
|
|
26
|
+
* update arms the stability timer. The timer is process-level (lives in this
|
|
27
|
+
* gate, which the process owns), so it survives WS reconnects; a disconnect
|
|
28
|
+
* does NOT cancel it.
|
|
25
29
|
* - timer elapses with the process still alive → `confirmVersion()`. (A
|
|
26
30
|
* process exit/crash before the timer means it simply never fires.)
|
|
27
31
|
* - `onSupervisorEnded()` — the supervisor instance stopped (clean shutdown OR
|
|
28
32
|
* a runForever-caught soft crash). Cancel the timer so a stale timer can't
|
|
29
|
-
* confirm across supervisor instances; the next supervisor
|
|
30
|
-
*
|
|
33
|
+
* confirm across supervisor instances; the next supervisor instance re-arms
|
|
34
|
+
* it. This RESETS the health window but NEVER records a rollback
|
|
31
35
|
* failure — soft crashes are not rollback signals. Rollback `boot_count` is
|
|
32
36
|
* incremented only by process-level unclean exits (crash / kill / power loss
|
|
33
37
|
* / uncaught fatal exit), tracked via the `daemon-running` marker in
|
|
@@ -48,16 +52,16 @@ export declare class PendingUpdateHealthGate {
|
|
|
48
52
|
private confirmed;
|
|
49
53
|
constructor(updater: DaemonUpdater, stabilityWindowMs: number, log: GatewayLogger, timers?: TimerApi);
|
|
50
54
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
55
|
+
* A supervisor instance started. Arms the stability timer when there is a
|
|
56
|
+
* pending (unconfirmed) update. No-op once confirmed, while a timer is
|
|
53
57
|
* already running, or when there is nothing pending to confirm.
|
|
54
58
|
*/
|
|
55
|
-
|
|
59
|
+
onSupervisorStarted(): void;
|
|
56
60
|
/**
|
|
57
61
|
* The current supervisor instance ended — a clean shutdown or a
|
|
58
62
|
* runForever-caught soft crash. Reset the health window (cancel the pending
|
|
59
63
|
* confirm timer) without recording any rollback failure; the next supervisor
|
|
60
|
-
* re-arms via `
|
|
64
|
+
* re-arms via `onSupervisorStarted`.
|
|
61
65
|
*/
|
|
62
66
|
onSupervisorEnded(): void;
|
|
63
67
|
private confirm;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-health-gate.d.ts","sourceRoot":"","sources":["../src/update-health-gate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,KAAK,WAAW,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AAE1C,KAAK,QAAQ,GAAG;IACd,UAAU,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,EAAE,EAAE,MAAM,GAAG,WAAW,CAAC;IAC1D,YAAY,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;CACzC,CAAC;AAOF
|
|
1
|
+
{"version":3,"file":"update-health-gate.d.ts","sourceRoot":"","sources":["../src/update-health-gate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,KAAK,WAAW,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AAE1C,KAAK,QAAQ,GAAG;IACd,UAAU,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,EAAE,EAAE,MAAM,GAAG,WAAW,CAAC;IAC1D,YAAY,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;CACzC,CAAC;AAOF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,qBAAa,uBAAuB;IAKhC,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAPzB,OAAO,CAAC,KAAK,CAA4B;IACzC,OAAO,CAAC,SAAS,CAAS;gBAGP,OAAO,EAAE,aAAa,EACtB,iBAAiB,EAAE,MAAM,EACzB,GAAG,EAAE,aAAa,EAClB,MAAM,GAAE,QAAqB;IAGhD;;;;OAIG;IACH,mBAAmB,IAAI,IAAI;IAc3B;;;;;OAKG;IACH,iBAAiB,IAAI,IAAI;IAOzB,OAAO,CAAC,OAAO;CAShB"}
|
|
@@ -7,22 +7,26 @@ const realTimers = {
|
|
|
7
7
|
* version healthy enough to confirm?" policy in ONE place so it isn't smeared
|
|
8
8
|
* across the supervisor's WS handlers.
|
|
9
9
|
*
|
|
10
|
-
* A pending update is confirmed
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* A pending update is confirmed by process stability alone: the process +
|
|
11
|
+
* supervisor stay up for `stabilityWindowMs` after the supervisor instance
|
|
12
|
+
* starts, without the supervisor soft-crashing or the process exiting. Nothing
|
|
13
|
+
* about the control plane participates — not the bootstrap, not the WebSocket
|
|
14
|
+
* handshake. A daemon that cannot reach the server (offline, or its machine key
|
|
15
|
+
* rejected) is still a healthy *process*, and rollback exists to catch bundles
|
|
16
|
+
* that crash, not bundles that cannot authenticate; tying confirmation to the
|
|
17
|
+
* server froze such machines on their pending version forever.
|
|
14
18
|
*
|
|
15
19
|
* Lifecycle:
|
|
16
|
-
* - `
|
|
17
|
-
* stability timer. The timer is process-level (lives in this
|
|
18
|
-
* process owns), so it survives WS reconnects; a disconnect
|
|
19
|
-
* it.
|
|
20
|
+
* - `onSupervisorStarted()` — a supervisor instance starting with a pending
|
|
21
|
+
* update arms the stability timer. The timer is process-level (lives in this
|
|
22
|
+
* gate, which the process owns), so it survives WS reconnects; a disconnect
|
|
23
|
+
* does NOT cancel it.
|
|
20
24
|
* - timer elapses with the process still alive → `confirmVersion()`. (A
|
|
21
25
|
* process exit/crash before the timer means it simply never fires.)
|
|
22
26
|
* - `onSupervisorEnded()` — the supervisor instance stopped (clean shutdown OR
|
|
23
27
|
* a runForever-caught soft crash). Cancel the timer so a stale timer can't
|
|
24
|
-
* confirm across supervisor instances; the next supervisor
|
|
25
|
-
*
|
|
28
|
+
* confirm across supervisor instances; the next supervisor instance re-arms
|
|
29
|
+
* it. This RESETS the health window but NEVER records a rollback
|
|
26
30
|
* failure — soft crashes are not rollback signals. Rollback `boot_count` is
|
|
27
31
|
* incremented only by process-level unclean exits (crash / kill / power loss
|
|
28
32
|
* / uncaught fatal exit), tracked via the `daemon-running` marker in
|
|
@@ -48,11 +52,11 @@ export class PendingUpdateHealthGate {
|
|
|
48
52
|
this.timers = timers;
|
|
49
53
|
}
|
|
50
54
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
55
|
+
* A supervisor instance started. Arms the stability timer when there is a
|
|
56
|
+
* pending (unconfirmed) update. No-op once confirmed, while a timer is
|
|
53
57
|
* already running, or when there is nothing pending to confirm.
|
|
54
58
|
*/
|
|
55
|
-
|
|
59
|
+
onSupervisorStarted() {
|
|
56
60
|
if (this.confirmed || this.timer)
|
|
57
61
|
return;
|
|
58
62
|
if (!this.updater.hasPendingActivation())
|
|
@@ -71,7 +75,7 @@ export class PendingUpdateHealthGate {
|
|
|
71
75
|
* The current supervisor instance ended — a clean shutdown or a
|
|
72
76
|
* runForever-caught soft crash. Reset the health window (cancel the pending
|
|
73
77
|
* confirm timer) without recording any rollback failure; the next supervisor
|
|
74
|
-
* re-arms via `
|
|
78
|
+
* re-arms via `onSupervisorStarted`.
|
|
75
79
|
*/
|
|
76
80
|
onSupervisorEnded() {
|
|
77
81
|
if (this.timer) {
|
package/dist/updater.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updater.d.ts","sourceRoot":"","sources":["../src/updater.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAEL,KAAK,aAAa,EAGnB,MAAM,uBAAuB,CAAC;AAgB/B,MAAM,WAAW,WAAW;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,aAAa;IAMtB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAA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AC;IAQhF;;;;;;OAMG;IACH,aAAa,CAAC,eAAe,EAAE,OAAO,GAAG,OAAO;IAuDhD;;;OAGG;IACH,cAAc,IAAI,IAAI;IAatB;;OAEG;IACH,eAAe,IAAI,MAAM,GAAG,SAAS;IAIrC;;;;OAIG;IACH,oBAAoB,IAAI,OAAO;IAM/B;;;OAGG;IACG,cAAc,IAAI,OAAO,CAAC;QAC9B,SAAS,EAAE,OAAO,CAAC;QACnB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;YAuBY,QAAQ;IAyJtB,OAAO,CAAC,UAAU;IAmClB,OAAO,CAAC,WAAW;IAUnB,OAAO,CAAC,gBAAgB;IAmBxB,iBAAiB,IAAI,aAAa,GAAG,IAAI;IAIzC,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,eAAe;IA+BvB,OAAO,CAAC,QAAQ;IAYhB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,OAAO;IAuCf,OAAO,CAAC,YAAY;IA6CpB,OAAO,CAAC,QAAQ;CAKjB;AAID,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAEzE;AAED,0EAA0E;AAC1E,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAErE"}
|
package/dist/updater.js
CHANGED
|
@@ -206,15 +206,11 @@ export class DaemonUpdater {
|
|
|
206
206
|
async doUpdate(targetVersion) {
|
|
207
207
|
const local = this.loadLocalManifest();
|
|
208
208
|
const state = this.loadUpdateState();
|
|
209
|
-
//
|
|
210
|
-
//
|
|
211
|
-
//
|
|
212
|
-
//
|
|
213
|
-
|
|
214
|
-
this.log.info(`update: ${local.version} is still pending activation — skipping new update until confirmed`);
|
|
215
|
-
this.report('skipped', 'pending_activation');
|
|
216
|
-
return false;
|
|
217
|
-
}
|
|
209
|
+
// A newer bundle may land on top of a still-pending one. Rollback safety
|
|
210
|
+
// does not depend on single-flight: `previous_version` below is always the
|
|
211
|
+
// last CONFIRMED version, never the pending intermediate, so a machine that
|
|
212
|
+
// cannot confirm (offline, machine key rejected) keeps receiving updates
|
|
213
|
+
// instead of freezing on the version it could not prove.
|
|
218
214
|
const manifestUrl = targetVersion
|
|
219
215
|
? `${this.cdnBaseUrl}/${targetVersion}/manifest.json`
|
|
220
216
|
: `${this.cdnBaseUrl}/latest/manifest.json`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parall/daemon",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.64.0",
|
|
4
4
|
"description": "Parall local agent runtime — daemon supervisor + bridge runtimes, bundled as standalone JS files",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"@opentelemetry/api": "^1.9.0",
|
|
35
35
|
"@pinixai/bb-browser-pro": "0.15.0",
|
|
36
36
|
"ws": "^8.18.0",
|
|
37
|
-
"@parall/
|
|
38
|
-
"@parall/
|
|
39
|
-
"@parall/codex-agent": "1.
|
|
40
|
-
"@parall/agent
|
|
41
|
-
"@parall/
|
|
37
|
+
"@parall/sdk": "1.64.0",
|
|
38
|
+
"@parall/claude-agent": "1.64.0",
|
|
39
|
+
"@parall/codex-agent": "1.64.0",
|
|
40
|
+
"@parall/openclaw-agent": "1.64.0",
|
|
41
|
+
"@parall/agent-core": "1.64.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/node": "^22.0.0",
|