From b215d5b2c2593e3274b7e4957a6e38284c3322e3 Mon Sep 17 00:00:00 2001 From: Yuriy Mayatnikov Date: Tue, 26 May 2026 13:54:16 +0300 Subject: [PATCH] fix(runtime/skills/chop-logs): stop repeated gather log timeouts --- runtime/skills/chop-logs.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/runtime/skills/chop-logs.js b/runtime/skills/chop-logs.js index a871075..4f2be7d 100644 --- a/runtime/skills/chop-logs.js +++ b/runtime/skills/chop-logs.js @@ -28,7 +28,10 @@ function withTimeout(promise, ms, label) { export const skill = Object.freeze({ id: "gather.logs", title: "Gather logs", - timeoutMs: 60_000, + // Must exceed chopNearestTree's own 60s collect timeout (plus the + // optional journal walk), otherwise runSkill times out first and retries + // gather.logs before the chop attempt can blacklist/recover. + timeoutMs: 90_000, preconditions(ctx) { if (!ctx?.bot) return { ok: false, code: "no_bot", detail: "bot missing" }; const known = logBlocks(ctx.bot); @@ -88,11 +91,14 @@ export const skill = Object.freeze({ return result.ok && !!result.worldDelta?.logType; }, recover(ctx, result) { - // Tell the caller: if there was no reachable log, switching to wander - // for ~60 s is the right next move — same heuristic the autonomous - // reflex already uses. + // Tell the caller: if there was no reachable log, or the attempted log + // took too long to path/dig, move away before retrying. This prevents + // repeated gather.logs timeouts in the same bad patch of terrain. if (result.code === "no_target") { - return { hint: "wander", reason: "no log within 32 blocks" }; + return { hint: "wander", reason: "no log within 64 blocks" }; + } + if (result.code === "timeout") { + return { hint: "wander", reason: "log gather timed out" }; } return null; },