diff --git a/server/states/IdleState.js b/server/states/IdleState.js index 50c32a0..890b7f6 100644 --- a/server/states/IdleState.js +++ b/server/states/IdleState.js @@ -14,8 +14,17 @@ export class IdleState extends BaseState { async *act() { // Periodic fuel check while idle (no scanning — avoids rotating turtle) + // Errors are caught here so they don't bubble up and trigger + // the _runStateLoop retry mechanism (which would create an + // infinite idle→timeout→idle loop). while (!this.cancelled) { - await this.checkFuel(); + try { + await this.checkFuel(); + } catch (e) { + // Fuel check failed (likely command timeout) — not critical in idle + // Just wait longer before trying again + await this._sleep(30000); + } yield; await this._sleep(10000); }