Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

Move the overdue-suspect probe out of MinionWorker.start and refresh the structural manifest (GST-2529)

garrytan64d07b1755cb
diff --git a/scripts/structural-suites.tsv b/scripts/structural-suites.tsv
index 9b1726eb41..3c321d6b43 100644
--- a/scripts/structural-suites.tsv
+++ b/scripts/structural-suites.tsv
@@ -443,6 +443,7 @@ test/timing-safe.test.ts extraction contract 1 source-surface-helper
test/title-fuzzy-index.test.ts findByTitleFuzzy indexed threshold 2 source-surface-helper
test/transcription-injection.test.ts transcription — command injection (#245) 2 readFileSync
test/trust-write-gate-drift.test.ts (file-level) 1 readFileSync
+test/unmanaged-push-every-site-gst2456.serial.test.ts gbrain git commit-push 8 readFileSync
test/upgrade-post-swap-imports.test.ts #6604 upgrade post-swap tail 3 readFileSync
test/upgrade.serial.test.ts detectInstallMethod — package-install classification (in-process) 5 readFileSync
test/upgrade.serial.test.ts runUpgrade target verification (#4366) 8 readFileSync
diff --git a/src/core/minions/worker.ts b/src/core/minions/worker.ts
index 895dd523af..3df88580d3 100644
--- a/src/core/minions/worker.ts
+++ b/src/core/minions/worker.ts
@@ -388,6 +388,14 @@ export class MinionWorker extends EventEmitter {
return this._configurationReleaseResults;
}
+ /** GST-2529: at most every min(wait, 5 s), ask whether a marked job is past its wait; a failed probe errs toward the drain. */
+ private async probeOverdueSuspect(): Promise<void> {
+ if (Date.now() < this.suspectProbeDueAt) return;
+ this.suspectProbeDueAt = Date.now() + Math.min(this.opts.watchdogSuspectWaitMs, SUSPECT_PROBE_EVERY_MS);
+ this.suspectOverdue = await this.queue.hasOverdueWatchdogSuspect(this.opts.queue, this.registeredNames, this.opts.watchdogSuspectWaitMs)
+ .catch(() => true);
+ }
+
private probeDatabase(): Promise<DbProbeResult> {
const dualPool = getConnectionRouting(this.engine)?.isDualPoolActive?.() === true;
const getDiag = (this.engine as { getPoolDiagnostics?: () => PoolDiagnostics | null }).getPoolDiagnostics;
@@ -817,12 +825,7 @@ export class MinionWorker extends EventEmitter {
}
}
- if (Date.now() >= this.suspectProbeDueAt) {
- this.suspectProbeDueAt = Date.now() + Math.min(this.opts.watchdogSuspectWaitMs, SUSPECT_PROBE_EVERY_MS);
- this.suspectOverdue = await this.queue.hasOverdueWatchdogSuspect(this.opts.queue, this.registeredNames, this.opts.watchdogSuspectWaitMs)
- .catch(() => true);
- }
-
+ await this.probeOverdueSuspect();
if (!this.running) break;
// Claim jobs up to concurrency limit — unless the system-wide pause
diff --git a/test/fixtures/goldens/exports/types.json b/test/fixtures/goldens/exports/types.json
index 8d2e026d9b..78bd48b841 100644
--- a/test/fixtures/goldens/exports/types.json
+++ b/test/fixtures/goldens/exports/types.json
@@ -6577,6 +6577,7 @@
"private pausedByMarkerAnnounced",
"private pendingClaim",
"private probeDatabase",
+ "private probeOverdueSuspect",
"private queue",
"private reconnectAfterConnectionError",
"private releaseClaimForPause",