Hmbown/CodeWhale · error · Error
--retry-delay-ms must be between 0 and 30000
Error message
--retry-delay-ms must be between 0 and 30000
What it means
The same gate script rejects --retry-delay-ms values that are not finite numbers in [0, 30000]. The check uses Number.isFinite, so NaN (non-numeric token) and Infinity fail, while fractional values such as 500.5 are accepted; the default is 3000 ms. The 30-second cap bounds how long a single retry cycle can stall a deploy pipeline.
Source
Thrown at web/scripts/compare-deployed-facts.mjs:119
let baseUrl;
try {
baseUrl = new URL(args.baseUrl);
} catch {
throw new Error(`invalid --base-url: ${args.baseUrl}`);
}
if (!/^https?:$/.test(baseUrl.protocol)) {
throw new Error("--base-url must use http or https");
}
const expectedRevision = args.expectedRevision || localRevision();
if (!expectedRevision || !/^[0-9a-f]{40}$/i.test(expectedRevision)) {
throw new Error("expected revision must be an exact 40-character Git SHA");
}
if (!Number.isInteger(args.attempts) || args.attempts < 1 || args.attempts > 20) {
throw new Error("--attempts must be an integer from 1 to 20");
}
if (!Number.isFinite(args.retryDelayMs) || args.retryDelayMs < 0 || args.retryDelayMs > 30_000) {
throw new Error("--retry-delay-ms must be between 0 and 30000");
}
const facts = buildFacts();
const expected = {
sourceRevision: expectedRevision,
version: facts.version,
providerCount: facts.providers.length,
toolCount: facts.toolCount,
latestPublishedRelease: facts.latestPublishedRelease,
};
const endpoint = new URL("/api/facts", baseUrl).toString();
let last = { error: "not attempted" };
let differences = [];
for (let attempt = 1; attempt <= args.attempts; attempt += 1) {
last = await fetchReceipt(endpoint);
differences = last.receipt ? compare(expected, last.receipt) : [];
if (last.receipt && differences.length === 0) break;View on GitHub (pinned to 8880682c63)
Solutions
- Keep the value in [0, 30000] milliseconds; the default 3000 is usually right
- Extend total patience with --attempts (up to 20), not with a longer delay
- Convert and clamp second-based settings before invoking: Math.min(30000, seconds * 1000)
- Omit the flag to accept the 3000 ms default
Example fix
// before node web/scripts/compare-deployed-facts.mjs --attempts 8 --retry-delay-ms 60000 // after node web/scripts/compare-deployed-facts.mjs --attempts 12 --retry-delay-ms 30000
Defensive patterns
Strategy: validation
Validate before calling
const ms = Number(settings.retryDelaySeconds ?? 3) * 1000;
const safeDelay = Number.isFinite(ms) ? Math.min(30_000, Math.max(0, ms)) : 3_000;
run('--retry-delay-ms', String(safeDelay)); Prevention
- Store delays in one unit and convert at the boundary
- Cap per-cycle delays at 30s and extend patience with --attempts instead
- Validate sourced numbers before building command lines
When it happens
Trigger: Invoking the script with --retry-delay-ms -1, --retry-delay-ms 31000, --retry-delay-ms abc, --retry-delay-ms Infinity, or a missing value token after the flag.
Common situations: Configs written in seconds copied verbatim (60000 for a 60-second wait); env interpolation producing an empty string; trying to stretch total wait time via delay instead of attempts.
Related errors
- --attempts must be an integer from 1 to 20
- Usage: node scripts/release/assemble-release-assets.js INP
- Invalid GitHub repository: ${repo}
- Invalid release tag: ${tag}
- unknown argument: ${arg}
AI-assisted analysis of Hmbown/CodeWhale@8880682c63 (2026-08-16).
Data as JSON: /api/errors/580411e963cb2a0e.
Report an issue: GitHub.