From 5a611355ced3bdaec408c4a4928f23cfb60bc899 Mon Sep 17 00:00:00 2001 From: Saffron <263493777+itsmiso-ai@users.noreply.github.com> Date: Fri, 4 Sep 2026 05:38:09 +0000 Subject: [PATCH 1/2] docs(env): document DISPATCH_STALE_WORK_INTERVAL_MS src/lib/scheduler.ts reads DISPATCH_STALE_WORK_INTERVAL_MS alongside the other scheduler intervals, but .env.example only documented the other five. The stale-work sweep is the recovery path for the agent-dies-mid-work failure mode (reclaim stale claims), and the scheduler tests explicitly pin "disable when set to 0" semantics for this knob, so operators should not have to read src/lib/scheduler.ts to discover it exists. Document it in the same shape as DISPATCH_RECONCILE_INTERVAL_MS et al., with the default value carried from DEFAULT_STALE_WORK_INTERVAL_MS in src/lib/scheduler.ts. No code change; defaults are unchanged when the env var is unset. Fixes #915 Signed-off-by: Saffron <263493777+itsmiso-ai@users.noreply.github.com> --- .env.example | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.env.example b/.env.example index da358abe..5069f843 100644 --- a/.env.example +++ b/.env.example @@ -232,6 +232,11 @@ DISPATCH_AGENT_TOKEN="your_agent_token_here" # disable. Default 1 800 000 (30 min). # DISPATCH_RECONCILE_INTERVAL_MS=1800000 +# Interval (ms) between automated `/api/agent-work/sweep` runs that reclaim +# agent-work leases abandoned by an agent that died mid-task. Set to "0" to +# disable. Default 300 000 (5 min). +# DISPATCH_STALE_WORK_INTERVAL_MS=300000 + # --- Framework / build-time vars (set by the platform, do not override) --- # NODE_ENV, NEXT_RUNTIME, and NEXT_PUBLIC_DISPATCH_VERSION are managed by the From 2203eb2bb8a9d79a0c3fc1b5a1fc4d0877ff5715 Mon Sep 17 00:00:00 2001 From: Saffron <263493777+itsmiso-ai@users.noreply.github.com> Date: Fri, 4 Sep 2026 06:07:37 +0000 Subject: [PATCH 2/2] fix(ci): retry npm audit on transient registry timeouts The CI npm audit step failed with "audit endpoint returned an error" because of a network timeout to https://registry.npmjs.org/-/npm/v1/security/advisories/bulk, not a real vulnerability (the audit itself reported "found 0 vulnerabilities"). Add --fetch-retries=5, --fetch-timeout=120000 and matching retry backoff flags so `npm run audit` rides out brief registry timeouts instead of failing the whole CI run. Stacks on the prior .env.example entry for DISPATCH_STALE_WORK_INTERVAL_MS that documents the stale-work sweep knob operators need to tune. Fixes #915 Signed-off-by: Saffron <263493777+itsmiso-ai@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bfc696b2..e25fe054 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "dev": "next dev", "build": "NODE_ENV=production next build", "start": "next start", - "audit": "npm audit --omit=dev --audit-level=high", + "audit": "npm audit --omit=dev --audit-level=high --fetch-retries=5 --fetch-timeout=120000 --fetch-retry-mintimeout=20000 --fetch-retry-maxtimeout=120000", "lint": "NODE_ENV=development eslint .", "test": "NODE_ENV=development vitest run", "test:watch": "NODE_ENV=development vitest",