MCPcopy Create free account
hub / github.com/EvoMap/evolver / handleCycleTimeout

Function handleCycleTimeout

index.js:467–488  ·  view source on GitHub ↗
({ error, cycleProgressPath, progressFields, suicideEnabled, args, logPath, spawnReplacementFn })

Source from the content-addressed store, hash-verified

465}
466
467function handleCycleTimeout({ error, cycleProgressPath, progressFields, suicideEnabled, args, logPath, spawnReplacementFn }) {
468 const msg = error && error.message ? String(error.message) : String(error);
469 console.error('[Daemon] ' + msg);
470
471 if (!suicideEnabled) {
472 console.warn('[Daemon] Cycle hard-timeout treated as non-fatal because EVOLVER_SUICIDE=false.');
473 writeCycleProgressAtomic(cycleProgressPath, Object.assign({}, progressFields, {
474 phase: 'cycle_timeout_nonfatal',
475 }));
476 return { action: 'continue' };
477 }
478
479 writeCycleProgressAtomic(cycleProgressPath, Object.assign({}, progressFields, {
480 phase: 'cycle_timeout_respawn',
481 }));
482 spawnReplacementFn({
483 reason: 'cycle_hard_timeout',
484 args: args,
485 logPath: logPath,
486 });
487 return { action: 'respawn' };
488}
489
490function logTimedOutEvolveRejection(error, logFn) {
491 const lateMsg = error && error.message ? String(error.message) : String(error);

Callers 2

mainFunction · 0.85
loopMode.test.jsFile · 0.85

Calls 1

writeCycleProgressAtomicFunction · 0.85

Tested by

no test coverage detected