commit 842ccbf311c749296cfe01e2010e54cf3dfe76fa
parent dcb8d285c45939b1615ab8b2480d9cfd67e369a3
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Fri, 25 Sep 2026 11:33:10 -0400
common: (review fix) the /jobs lane note says "deferred" too
activeJobs autoIdleNote gains the deferred case with the console's exact
sentence, and is typed AutoRunnerIdleReason | null with no default, so a
new idle reason is a compile error here as in dispatch.ts. activeJobs.test +1.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
2 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/common/views/activeJobs.test.ts b/common/views/activeJobs.test.ts
@@ -322,6 +322,21 @@ test("a stopped runner reads unavailable, not idle", async () => {
assert.equal(payload.lanes.length, 4);
});
+test("a download runner idling on deferred videos says so on its lane", async () => {
+ const h = harness({
+ runner: (kind) =>
+ kind === "download"
+ ? runnerStatus({ kind, idleReason: "deferred" })
+ : runnerStatus({ kind, idleReason: "no-pending" }),
+ });
+ const payload = await buildActiveJobsPayload(h.inputs);
+ const download = payload.lanes.find((l) => l.label === "Auto-download");
+ assert.equal(
+ download?.note,
+ "every pending video was rate-limited recently and is deferred",
+ );
+});
+
test("the disk block is the gate the shell sampled, with `low` derived", async () => {
const h = harness({
disk: { ...OK_DISK, ok: false, freeBytes: 1, reason: "below-floor", message: "full" },
diff --git a/common/views/activeJobs.ts b/common/views/activeJobs.ts
@@ -13,7 +13,10 @@ import { deriveLaneState } from "./laneState";
import { autoRunnerJobKind } from "../controller/autoRunner";
import { isGateHeld } from "../lib/pauseGates";
import { LANES, type AutoQueueKind } from "../lib/autoQueueTypes";
-import type { AutoRunnerStatus } from "../controller/autoRunner";
+import type {
+ AutoRunnerIdleReason,
+ AutoRunnerStatus,
+} from "../controller/autoRunner";
import type { JobRecord } from "../jobs/registry";
import type { QueueView } from "../jobs/scheduler";
import type { JobMeta } from "../jobs/jobMeta";
@@ -385,7 +388,7 @@ const LANE_LABEL: Record<AutoQueueKind, string> = {
// kept server-side because this payload is consumed by three clients and the
// sentence must be the same in all three.
function autoIdleNote(
- reason: string | null,
+ reason: AutoRunnerIdleReason | null,
kind: AutoQueueKind,
): string | null {
switch (reason) {
@@ -395,6 +398,8 @@ function autoIdleNote(
return "every route to the work is at a worker cap";
case "cooldown":
return "every pending platform is in a rate-limit cooldown";
+ case "deferred":
+ return "every pending video was rate-limited recently and is deferred";
case "no-workers":
return "no enabled worker";
case "workers-paused":
@@ -411,7 +416,10 @@ function autoIdleNote(
return "snoozed";
case "disabled":
return `the ${LANE_LABEL[kind].toLowerCase()} lane is switched off`;
- default:
+ // Exhaustive (no default), so a new idle reason is a compile error here
+ // as it is in the console's idleReasonText.
+ case "stopped":
+ case null:
return null;
}
}