@parall/daemon 1.62.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.
@@ -0,0 +1,358 @@
1
+ import { spawn } from 'node:child_process';
2
+ import * as fs from 'node:fs';
3
+ import * as os from 'node:os';
4
+ import * as path from 'node:path';
5
+ import * as zlib from 'node:zlib';
6
+ import { maskKnownValues, redactSecrets, resolveServiceVersion } from '@parall/agent-core';
7
+ import { MACHINE_DIAGNOSTICS_NOTE_MAX_CHARS, } from '@parall/sdk';
8
+ import { agentHomeDirFor, agentWorkspaceDirFor, daemonConfigDir, resolveBundleDir, resolveRootStateDir, } from './config.js';
9
+ import { proxyEnvNames } from './daemon-telemetry.js';
10
+ import { isSelfUpdateManaged } from './daemon-update-mode.js';
11
+ import { DETECTABLE_RUNTIME_TYPES } from './runtime-bin-resolver.js';
12
+ import { detectRuntimes } from './runtime-detector.js';
13
+ import { buildMachineRuntimeReport } from './runtime-report.js';
14
+ import { loadLocalManifest, loadUpdateState } from './updater.js';
15
+ import { winServicePaths } from './win-service.js';
16
+ /**
17
+ * Diagnostics bundle (daemon-diagnostics-bundle-design.md): what a
18
+ * self-hosted machine's owner sends the platform to get a problem looked at.
19
+ * Assembled OUT of process from files on disk — the CLI (and the Desktop
20
+ * button, which runs the CLI) never talks to the running daemon.
21
+ *
22
+ * Everything in the bundle comes from the ALLOWLIST below; nothing is read
23
+ * from anywhere else. The one credential this process can see, config.json's
24
+ * `api_key`, is dropped from the config copy and used as an exact value for
25
+ * redacting the log tail. Credentials the daemon keeps in memory (per-agent
26
+ * agk_ launch keys, PRLL_PROVIDER_CONFIG) are not on disk and can only be
27
+ * caught by redactSecrets' prefix rules — the log tail is the bridges' raw
28
+ * stdout/stderr, so that rule set is the floor, not a guarantee.
29
+ */
30
+ export const DIAGNOSTICS_SCHEMA_VERSION = 1;
31
+ /** Bytes of the log file's tail that travel; well under the server's 16 MB body cap. */
32
+ export const DIAGNOSTICS_LOG_TAIL_BYTES = 1 << 20;
33
+ /** Runtime probes spawn `--version` (and maybe a login shell); bound the whole step. */
34
+ export const DIAGNOSTICS_DETECT_BUDGET_MS = 20_000;
35
+ export const DIAGNOSTICS_NOTE_MAX_CHARS = MACHINE_DIAGNOSTICS_NOTE_MAX_CHARS;
36
+ /** Env keys whose VALUES are safe to include; every other PRLL_* key contributes its name only. */
37
+ const ENV_VALUE_ALLOWLIST = new Set([
38
+ 'PRLL_DAEMON_CONFIG_DIR',
39
+ 'PRLL_DAEMON_BUNDLE_DIR',
40
+ 'PRLL_SERVER_ENV',
41
+ 'PRLL_DAEMON_MANAGED',
42
+ 'PRLL_DAEMON_UPDATE_CDN_URL',
43
+ 'PRLL_DAEMON_UPDATE_CHANNEL',
44
+ 'PRLL_DAEMON_UPDATE_INTERVAL_MS',
45
+ 'PRLL_DAEMON_UPDATE_DISABLED',
46
+ 'PRLL_DAEMON_UPDATE_CONFIRM_DELAY_MS',
47
+ 'PRLL_DAEMON_HOME_ISOLATION',
48
+ 'PRLL_CLIP_RUNTIME_ENABLED',
49
+ 'PRLL_OTEL_SPOOL_DIR',
50
+ ]);
51
+ const CONFIG_KEYS_ALLOWLIST = ['api_url', 'machine_id', 'org_id', 'update_cdn_url'];
52
+ /** Allowlisted values that are URLs: only scheme, host and path leave the machine. */
53
+ const URL_VALUED_KEYS = new Set(['api_url', 'update_cdn_url', 'PRLL_DAEMON_UPDATE_CDN_URL']);
54
+ /**
55
+ * A URL as it may appear in the bundle: userinfo, query and fragment are the
56
+ * places a credential usually rides along (`https://u:p@host/?token=…`), so
57
+ * they are dropped outright; what remains (and an unparseable value) still
58
+ * goes through `redactSecrets`, so a credential-shaped path segment is masked
59
+ * like it would be in the log. The daemon's own config is never rewritten.
60
+ */
61
+ export function sanitizeUrlValue(value, knownSecrets) {
62
+ let kept = value;
63
+ try {
64
+ const u = new URL(value);
65
+ // Only http(s) with a host has the scheme/host/path shape the contract
66
+ // keeps; anything else (mailto:, data:, file:) is opaque content.
67
+ if ((u.protocol !== 'http:' && u.protocol !== 'https:') || !u.host)
68
+ return '***';
69
+ if (u.username || u.password || u.search || u.hash) {
70
+ kept = `${u.protocol}//${u.host}${u.pathname}`;
71
+ }
72
+ }
73
+ catch {
74
+ // not a URL: fall through to the redaction rules alone
75
+ }
76
+ return redactSecrets(kept, knownSecrets);
77
+ }
78
+ /** Other allowlisted strings (ids, directory paths) keep their shape: known-value masking only. */
79
+ function allowlistedValue(key, value, knownSecrets) {
80
+ if (typeof value !== 'string')
81
+ return value;
82
+ return URL_VALUED_KEYS.has(key)
83
+ ? sanitizeUrlValue(value, knownSecrets)
84
+ : maskKnownValues(value, knownSecrets);
85
+ }
86
+ /**
87
+ * The last `maxBytes` of a buffer as text. `total` is the size of the whole
88
+ * source (the buffer may already be its trailing window); when anything was
89
+ * cut, the text restarts at the next line so no partial line or split UTF-8
90
+ * sequence leads the tail. A window with no newline at all (one line longer
91
+ * than the window) is kept as the partial line: a huge bridge line is still
92
+ * evidence, and `truncated` says it was cut.
93
+ */
94
+ export function tailBuffer(buf, maxBytes, total = buf.length) {
95
+ let window = buf.length > maxBytes ? buf.subarray(buf.length - maxBytes) : buf;
96
+ const truncated = total > window.length;
97
+ if (truncated) {
98
+ // A cut inside a multi-byte character would decode to U+FFFD (3 bytes
99
+ // each) and push the re-encoded size past maxBytes: skip continuation
100
+ // bytes so the window starts on a character boundary.
101
+ let start = 0;
102
+ while (start < window.length && (window[start] & 0xc0) === 0x80)
103
+ start++;
104
+ window = window.subarray(start);
105
+ }
106
+ let text = window.toString('utf-8');
107
+ if (truncated) {
108
+ const nl = text.indexOf('\n');
109
+ if (nl >= 0)
110
+ text = text.slice(nl + 1);
111
+ }
112
+ return { text, truncated };
113
+ }
114
+ /** Last maxBytes of a file, cut to a line boundary; empty when the file is absent. */
115
+ export function tailFile(file, maxBytes) {
116
+ let fd;
117
+ try {
118
+ fd = fs.openSync(file, 'r');
119
+ }
120
+ catch {
121
+ return { text: '', truncated: false };
122
+ }
123
+ try {
124
+ const size = fs.fstatSync(fd).size;
125
+ const start = Math.max(0, size - maxBytes);
126
+ const buf = Buffer.alloc(size - start);
127
+ fs.readSync(fd, buf, 0, buf.length, start);
128
+ return tailBuffer(buf, maxBytes, size);
129
+ }
130
+ finally {
131
+ fs.closeSync(fd);
132
+ }
133
+ }
134
+ /** Where this platform's daemon log lives for the CLI; Desktop passes its env-suffixed path. */
135
+ export function resolveDaemonLogPath(env = process.env) {
136
+ const explicit = env.PRLL_DAEMON_LOG_PATH?.trim();
137
+ if (explicit)
138
+ return explicit;
139
+ if (process.platform === 'win32')
140
+ return winServicePaths(os.homedir()).logFile;
141
+ if (process.platform === 'darwin') {
142
+ return path.join(os.homedir(), 'Library', 'Logs', 'parall-daemon.log');
143
+ }
144
+ return null;
145
+ }
146
+ async function defaultLogSource(env) {
147
+ const file = resolveDaemonLogPath(env);
148
+ if (file)
149
+ return { source: file, ...tailFile(file, DIAGNOSTICS_LOG_TAIL_BYTES) };
150
+ // Linux service installs log to journald.
151
+ try {
152
+ return {
153
+ source: 'journalctl --user-unit parall-daemon',
154
+ ...(await commandTail('journalctl', ['--user-unit', 'parall-daemon', '-n', '4000', '-o', 'cat', '--no-pager'], DIAGNOSTICS_LOG_TAIL_BYTES)),
155
+ };
156
+ }
157
+ catch (err) {
158
+ return { source: 'journalctl (failed)', text: String(err), truncated: false };
159
+ }
160
+ }
161
+ /**
162
+ * Run a command and keep only the trailing `maxBytes` of its stdout, however
163
+ * much it prints: the buffer is trimmed as chunks arrive, so a verbose journal
164
+ * never hits a fixed maxBuffer and loses the useful end. Rejects when the
165
+ * command cannot start or exits non-zero without printing anything.
166
+ */
167
+ export function commandTail(cmd, args, maxBytes) {
168
+ return new Promise((resolve, reject) => {
169
+ const child = spawn(cmd, args, { stdio: ['ignore', 'pipe', 'pipe'] });
170
+ let kept = Buffer.alloc(0);
171
+ let total = 0;
172
+ let stderr = '';
173
+ child.stdout.on('data', (chunk) => {
174
+ total += chunk.length;
175
+ kept = Buffer.concat([kept, chunk]);
176
+ // Keep a little more than the window so the line cut still has slack.
177
+ if (kept.length > maxBytes * 2)
178
+ kept = kept.subarray(kept.length - maxBytes);
179
+ });
180
+ child.stderr.on('data', (chunk) => {
181
+ if (stderr.length < 4096)
182
+ stderr += chunk.toString('utf-8');
183
+ });
184
+ child.on('error', reject);
185
+ child.on('close', (code) => {
186
+ if (code !== 0 && total === 0) {
187
+ reject(new Error(`${cmd} exited with code ${code}: ${stderr.trim()}`));
188
+ return;
189
+ }
190
+ resolve(tailBuffer(kept, maxBytes, total));
191
+ });
192
+ });
193
+ }
194
+ function readJson(file) {
195
+ try {
196
+ const parsed = JSON.parse(fs.readFileSync(file, 'utf-8'));
197
+ return parsed && typeof parsed === 'object' ? parsed : null;
198
+ }
199
+ catch {
200
+ return null;
201
+ }
202
+ }
203
+ function listDir(dir) {
204
+ try {
205
+ return fs.readdirSync(dir).sort();
206
+ }
207
+ catch {
208
+ return [];
209
+ }
210
+ }
211
+ function spoolStats(spoolRoot) {
212
+ const out = [];
213
+ for (const dir of listDir(spoolRoot)) {
214
+ for (const signal of listDir(path.join(spoolRoot, dir))) {
215
+ const signalDir = path.join(spoolRoot, dir, signal);
216
+ let files = 0;
217
+ let bytes = 0;
218
+ let oldest = null;
219
+ for (const name of listDir(signalDir)) {
220
+ if (!name.endsWith('.pb'))
221
+ continue;
222
+ try {
223
+ bytes += fs.statSync(path.join(signalDir, name)).size;
224
+ }
225
+ catch {
226
+ continue;
227
+ }
228
+ files += 1;
229
+ const ts = Number(name.slice(0, 13));
230
+ if (Number.isFinite(ts) && (oldest === null || ts < oldest))
231
+ oldest = ts;
232
+ }
233
+ if (files > 0) {
234
+ out.push({
235
+ dir,
236
+ signal,
237
+ files,
238
+ bytes,
239
+ oldest_at: oldest === null ? null : new Date(oldest).toISOString(),
240
+ });
241
+ }
242
+ }
243
+ }
244
+ return out;
245
+ }
246
+ function agentDirStats(stateDir) {
247
+ const out = [];
248
+ for (const agentId of listDir(path.join(stateDir, 'agents'))) {
249
+ try {
250
+ // The per-agent layout resolvers reject names that are not agent ids
251
+ // (a stray .DS_Store); those are not agents and are skipped.
252
+ out.push({
253
+ agent_id: agentId,
254
+ workspace: fs.existsSync(agentWorkspaceDirFor(stateDir, agentId)),
255
+ home: fs.existsSync(agentHomeDirFor(stateDir, agentId)),
256
+ });
257
+ }
258
+ catch {
259
+ // not an agent directory
260
+ }
261
+ }
262
+ return out;
263
+ }
264
+ function withBudget(promise, ms, fallback) {
265
+ return new Promise((resolve) => {
266
+ // Deliberately NOT unref'd: the timer is the only thing keeping the loop
267
+ // alive while a stuck probe never settles, and it is cleared the moment
268
+ // the probe answers.
269
+ const timer = setTimeout(() => resolve(fallback), ms);
270
+ promise.then((v) => {
271
+ clearTimeout(timer);
272
+ resolve(v);
273
+ }, () => {
274
+ clearTimeout(timer);
275
+ resolve(fallback);
276
+ });
277
+ });
278
+ }
279
+ export async function collectDiagnostics(opts = {}) {
280
+ const env = opts.env ?? process.env;
281
+ const now = opts.now ?? (() => new Date());
282
+ const configDir = daemonConfigDir(env);
283
+ const bundleDir = resolveBundleDir(env);
284
+ const rawConfig = readJson(path.join(configDir, 'config.json')) ?? {};
285
+ const apiKey = typeof rawConfig.api_key === 'string' ? rawConfig.api_key : '';
286
+ const config = {};
287
+ for (const key of CONFIG_KEYS_ALLOWLIST) {
288
+ if (key in rawConfig)
289
+ config[key] = allowlistedValue(key, rawConfig[key], [apiKey]);
290
+ }
291
+ const stateDir = resolveRootStateDir(env);
292
+ const manifest = loadLocalManifest(bundleDir);
293
+ const manifestVersion = typeof manifest?.version === 'string' ? manifest.version : null;
294
+ const bundleVersions = listDir(path.join(bundleDir, 'versions'));
295
+ // The runtime probe and the log source are independent; overlap them.
296
+ const [detected, log] = await Promise.all([
297
+ withBudget(opts.detect ? opts.detect() : detectRuntimes(env, { info() { }, warn() { } }), opts.detectBudgetMs ?? DIAGNOSTICS_DETECT_BUDGET_MS, null),
298
+ opts.logSource ? opts.logSource() : defaultLogSource(env),
299
+ ]);
300
+ const runtimeReport = detected === null
301
+ ? { skipped: 'timeout' }
302
+ : buildMachineRuntimeReport({
303
+ daemonVersion: manifestVersion ?? undefined,
304
+ selfUpdateCapable: isSelfUpdateManaged(bundleDir, env),
305
+ detected,
306
+ runtimeTypes: DETECTABLE_RUNTIME_TYPES,
307
+ });
308
+ const present = Object.keys(env)
309
+ .filter((k) => k.startsWith('PRLL_'))
310
+ .sort();
311
+ const values = {};
312
+ for (const key of present) {
313
+ if (ENV_VALUE_ALLOWLIST.has(key) && env[key]) {
314
+ values[key] = allowlistedValue(key, env[key], [apiKey]);
315
+ }
316
+ }
317
+ const redacted = redactSecrets(log.text, [apiKey]);
318
+ return {
319
+ schema_version: DIAGNOSTICS_SCHEMA_VERSION,
320
+ created_at: now().toISOString(),
321
+ manifest: {
322
+ daemon_version: resolveServiceVersion(opts.importMetaUrl ?? import.meta.url),
323
+ bundle_manifest_version: manifestVersion,
324
+ platform: process.platform,
325
+ arch: process.arch,
326
+ node_version: process.versions.node,
327
+ os_release: os.release(),
328
+ hostname_length: os.hostname().length,
329
+ config_dir: configDir,
330
+ bundle_dir: bundleDir,
331
+ state_dir: stateDir,
332
+ },
333
+ config,
334
+ update_state: loadUpdateState(bundleDir),
335
+ bundle_versions: bundleVersions,
336
+ runtime_report: runtimeReport,
337
+ spool: spoolStats(path.join(configDir, 'otel-spool')),
338
+ agents: agentDirStats(stateDir),
339
+ env: { present, values, proxy: proxyEnvNames(env) },
340
+ log: {
341
+ source: log.source,
342
+ truncated: log.truncated,
343
+ bytes: Buffer.byteLength(redacted, 'utf-8'),
344
+ text: redacted,
345
+ },
346
+ };
347
+ }
348
+ /** The wire form: gzip of the JSON document. */
349
+ export function serializeBundle(bundle) {
350
+ return zlib.gzipSync(Buffer.from(JSON.stringify(bundle), 'utf-8'), { level: 9 });
351
+ }
352
+ export async function uploadDiagnostics(client, bundle, note) {
353
+ const bytes = serializeBundle(bundle);
354
+ return client.uploadMachineDiagnostics(new Uint8Array(bytes), {
355
+ daemon_version: bundle.manifest.daemon_version,
356
+ ...(note ? { note } : {}),
357
+ });
358
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"supervisor.d.ts","sourceRoot":"","sources":["../src/supervisor.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAyC,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC/F,OAAO,EAiBL,KAAK,YAAY,EAClB,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;AAsBvE;;;;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,CAAq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8B,IAAI,OAAO,CAAC,IAAI,CAAC;IAerD,0FAA0F;YAC5E,oBAAoB;IAYlC,OAAO,CAAC,mBAAmB;IAe3B,OAAO,CAAC,uBAAuB;IAyB/B,OAAO,CAAC,aAAa;IAgBrB,OAAO,CAAC,mBAAmB;YAab,mBAAmB;IAyCjC,OAAO,CAAC,wBAAwB;YAelB,6BAA6B;IAqC3C,OAAO,CAAC,2BAA2B;IAYnC,OAAO,CAAC,wBAAwB;YAUlB,oBAAoB;IAwClC;;;;;;;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"}
@@ -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
- state.restartAttempts = 0;
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
- this.startChild(state);
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 only when BOTH hold:
16
- * - the control-plane handshake (machine.hello) is seen at least once, AND
17
- * - the process + supervisor then stay up for `stabilityWindowMs` without the
18
- * supervisor soft-crashing or the process exiting.
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
- * - `onMachineHello()` — the first hello with a pending update arms the
22
- * stability timer. The timer is process-level (lives in this gate, which the
23
- * process owns), so it survives WS reconnects; a disconnect does NOT cancel
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's machine.hello
30
- * re-arms it. This RESETS the health window but NEVER records a rollback
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
- * Control-plane handshake. Arms the stability timer on the first hello that
52
- * sees a pending (unconfirmed) update. No-op once confirmed, while a timer is
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
- onMachineHello(): void;
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 `onMachineHello`.
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,W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