@clawling/clawchat-plugin-openclaw 2026.7.8-1 → 2026.7.8-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.
@@ -258,6 +258,9 @@ const RESTART_WINDOW_MS = 30 * 60 * 1000;
258
258
  const MAX_RESTARTS_PER_WINDOW = 5;
259
259
  const INTRO_RETRY_DELAY_MS = 30_000;
260
260
  const INTRO_MAX_TRIES = 20;
261
+ // Backoff for transient start() failures (template CDN 429s, network blips):
262
+ // a one-shot bootstrap would otherwise stay dormant until the next restart.
263
+ const START_RETRY_DELAYS_MS = [30_000, 60_000, 120_000, 300_000];
261
264
  export class LivewareSampleSupervisor {
262
265
  deps;
263
266
  serverChild = null;
@@ -272,8 +275,12 @@ export class LivewareSampleSupervisor {
272
275
  constructor(deps) {
273
276
  this.deps = deps;
274
277
  }
275
- /** Entry point. Never throws; every failure is logged + persisted only. */
278
+ /** Entry point. Never throws; every failure is logged + persisted only.
279
+ * Transient failures are retried on the START_RETRY_DELAYS_MS backoff. */
276
280
  async start() {
281
+ await this.startAttempt(0);
282
+ }
283
+ async startAttempt(attempt) {
277
284
  const { deps } = this;
278
285
  try {
279
286
  if (!deps.enabled)
@@ -299,7 +306,13 @@ export class LivewareSampleSupervisor {
299
306
  // A mid-flow failure (e.g. registerApp rejected) may have left children
300
307
  // running without a persisted row — never leak orphan processes.
301
308
  this.killChildren();
302
- deps.log?.warn?.(`clawchat-plugin-openclaw liveware-sample start failed: ${String(err)}`);
309
+ const delayMs = START_RETRY_DELAYS_MS[attempt];
310
+ if (delayMs === undefined || this.stopped) {
311
+ deps.log?.warn?.(`clawchat-plugin-openclaw liveware-sample start failed (attempt ${attempt + 1}, giving up): ${String(err)}`);
312
+ return;
313
+ }
314
+ deps.log?.warn?.(`clawchat-plugin-openclaw liveware-sample start failed (attempt ${attempt + 1}, retrying in ${delayMs / 1000}s): ${String(err)}`);
315
+ this.schedule(() => { void this.startAttempt(attempt + 1); }, delayMs);
303
316
  }
304
317
  }
305
318
  stop() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clawling/clawchat-plugin-openclaw",
3
- "version": "2026.7.8-1",
3
+ "version": "2026.7.8-2",
4
4
  "description": "OpenClaw ClawChat channel plugin",
5
5
  "license": "MIT",
6
6
  "author": "CLAWLING PTE. LTD.",
@@ -374,6 +374,9 @@ const RESTART_WINDOW_MS = 30 * 60 * 1000;
374
374
  const MAX_RESTARTS_PER_WINDOW = 5;
375
375
  const INTRO_RETRY_DELAY_MS = 30_000;
376
376
  const INTRO_MAX_TRIES = 20;
377
+ // Backoff for transient start() failures (template CDN 429s, network blips):
378
+ // a one-shot bootstrap would otherwise stay dormant until the next restart.
379
+ const START_RETRY_DELAYS_MS = [30_000, 60_000, 120_000, 300_000];
377
380
 
378
381
  export class LivewareSampleSupervisor {
379
382
  private readonly deps: LivewareSampleSupervisorDeps;
@@ -391,8 +394,13 @@ export class LivewareSampleSupervisor {
391
394
  this.deps = deps;
392
395
  }
393
396
 
394
- /** Entry point. Never throws; every failure is logged + persisted only. */
397
+ /** Entry point. Never throws; every failure is logged + persisted only.
398
+ * Transient failures are retried on the START_RETRY_DELAYS_MS backoff. */
395
399
  async start(): Promise<void> {
400
+ await this.startAttempt(0);
401
+ }
402
+
403
+ private async startAttempt(attempt: number): Promise<void> {
396
404
  const { deps } = this;
397
405
  try {
398
406
  if (!deps.enabled) return;
@@ -412,7 +420,17 @@ export class LivewareSampleSupervisor {
412
420
  // A mid-flow failure (e.g. registerApp rejected) may have left children
413
421
  // running without a persisted row — never leak orphan processes.
414
422
  this.killChildren();
415
- deps.log?.warn?.(`clawchat-plugin-openclaw liveware-sample start failed: ${String(err)}`);
423
+ const delayMs = START_RETRY_DELAYS_MS[attempt];
424
+ if (delayMs === undefined || this.stopped) {
425
+ deps.log?.warn?.(
426
+ `clawchat-plugin-openclaw liveware-sample start failed (attempt ${attempt + 1}, giving up): ${String(err)}`,
427
+ );
428
+ return;
429
+ }
430
+ deps.log?.warn?.(
431
+ `clawchat-plugin-openclaw liveware-sample start failed (attempt ${attempt + 1}, retrying in ${delayMs / 1000}s): ${String(err)}`,
432
+ );
433
+ this.schedule(() => { void this.startAttempt(attempt + 1); }, delayMs);
416
434
  }
417
435
  }
418
436