fix(auto): heartbeat before unit execution to prevent false-positive watchdog stalls
The HaltWatchdog fires when the loop goes >10s without a heartbeat. Each iteration ends with a heartbeat, but unit execution itself can take 3+ minutes. Without a heartbeat at the start of the unit phase, the watchdog detects idle and emits a false-positive 'possible stuck iteration' error. Add watchdog.heartbeat() immediately before both runUnitPhaseViaContract calls (one in the custom-engine path, one in the dev path) so the watchdog timer is reset before the long-running work begins. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
e7cf168824
commit
1e99bd669e
1 changed files with 2 additions and 0 deletions
|
|
@ -891,6 +891,7 @@ export async function autoLoop(ctx, pi, s, deps) {
|
||||||
}
|
}
|
||||||
// ── Unit execution (shared with dev path) ──
|
// ── Unit execution (shared with dev path) ──
|
||||||
await enforceMinRequestInterval(s, ic.prefs);
|
await enforceMinRequestInterval(s, ic.prefs);
|
||||||
|
watchdog.heartbeat(); // reset before long-running unit execution
|
||||||
const unitPhaseResult = await runUnitPhaseViaContract(
|
const unitPhaseResult = await runUnitPhaseViaContract(
|
||||||
ic,
|
ic,
|
||||||
iterData,
|
iterData,
|
||||||
|
|
@ -1214,6 +1215,7 @@ export async function autoLoop(ctx, pi, s, deps) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
await enforceMinRequestInterval(s, ic.prefs);
|
await enforceMinRequestInterval(s, ic.prefs);
|
||||||
|
watchdog.heartbeat(); // reset before long-running unit execution
|
||||||
const unitPhaseResult = await runUnitPhaseViaContract(
|
const unitPhaseResult = await runUnitPhaseViaContract(
|
||||||
ic,
|
ic,
|
||||||
iterData,
|
iterData,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue