({ error, cycleProgressPath, progressFields, suicideEnabled, args, logPath, spawnReplacementFn })
| 465 | } |
| 466 | |
| 467 | function 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 | |
| 490 | function logTimedOutEvolveRejection(error, logFn) { |
| 491 | const lateMsg = error && error.message ? String(error.message) : String(error); |
no test coverage detected