feat: add headerTimeout cfg option, default it on only for openai w/ default of 10s (#29484)

This commit is contained in:
Aiden Cline
2026-05-26 21:22:24 -05:00
committed by GitHub
parent 519d344470
commit f965db9e13
8 changed files with 257 additions and 8 deletions
+8
View File
@@ -3,6 +3,14 @@ import { STATUS_CODES } from "http"
import { iife } from "@/util/iife"
import type { ProviderID } from "./schema"
export class HeaderTimeoutError extends Error {
public override readonly name = "ProviderHeaderTimeoutError"
constructor(public readonly ms: number) {
super(`Provider response headers timed out after ${ms}ms`)
}
}
// Adapted from overflow detection patterns in:
// https://github.com/badlogic/pi-mono/blob/main/packages/ai/src/utils/overflow.ts
const OVERFLOW_PATTERNS = [