earendil-works/pi · error · Error
Invalid HTTP idle timeout: ${String(timeoutMs)}
Error message
Invalid HTTP idle timeout: ${String(timeoutMs)} What it means
Error "Invalid HTTP idle timeout: ${String(timeoutMs)}" thrown in earendil-works/pi.
Source
Thrown at packages/coding-agent/src/core/http-dispatcher.ts:84
}
function createUndiciOriginDispatcher(origin: string | URL, options: object): undici.Dispatcher {
const dispatcherOptions = options as undici.Pool.Options;
if (dispatcherOptions.connections === 1) {
return createUndiciClient(origin, dispatcherOptions);
}
return withUndiciErrorListener(
new undici.Pool(origin, {
...dispatcherOptions,
factory: createUndiciClient,
}),
);
}
export function configureHttpDispatcher(timeoutMs: number = DEFAULT_HTTP_IDLE_TIMEOUT_MS): void {
const normalizedTimeoutMs = parseHttpIdleTimeoutMs(timeoutMs);
if (normalizedTimeoutMs === undefined) {
throw new Error(`Invalid HTTP idle timeout: ${String(timeoutMs)}`);
}
const dispatcher = withUndiciErrorListener(
new undici.EnvHttpProxyAgent({
allowH2: false,
bodyTimeout: normalizedTimeoutMs,
connect: {
autoSelectFamilyAttemptTimeout: DEFAULT_AUTO_SELECT_FAMILY_ATTEMPT_TIMEOUT_MS,
},
headersTimeout: normalizedTimeoutMs,
clientFactory: createUndiciClient,
factory: createUndiciOriginDispatcher,
}),
);
undici.setGlobalDispatcher(dispatcher);
// Keep fetch and the dispatcher on the same undici implementation. Node 26.0's
// bundled fetch can otherwise consume compressed responses through npm undici's
// dispatcher without decompressing them, causing response.json() failures.
// If a caller replaced fetch after module load, preserve that deliberate override.View on GitHub (pinned to 4af9d21d3b)
When it happens
Trigger: Thrown at packages/coding-agent/src/core/http-dispatcher.ts:84 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24).
Data as JSON: /api/errors/43cee5247e16d99a.
Report an issue: GitHub.