fix(provider): 延长媒体超时并终止超时轮转

将图像和视频的默认 HTTP/轮询超时分别提高到 20 分钟和 30 分钟。媒体任务超时后直接失败,不再重试、切换客户端或标记为 upstream_submission_unknown。OpenAI 图像端点遇到上游明确拒绝 response_format 时自动移除并缓存兼容结论。

验证:go test ./... -count=1;go vet ./...;gofmt;相关 Shell bash -n、ShellCheck 与发布脚本回归测试。
This commit is contained in:
2026-08-05 13:58:02 +08:00
parent 9ce9053d7b
commit dd10a807df
23 changed files with 336 additions and 55 deletions
@@ -22,6 +22,7 @@ var safeUpstreamCorrectionParameters = stringSet(
"temperature", "top_p", "frequency_penalty", "presence_penalty", "seed", "stop", "n",
"max_tokens", "max_completion_tokens", "max_output_tokens",
"logprobs", "top_logprobs", "service_tier", "verbosity",
"response_format",
)
var (
@@ -286,6 +287,12 @@ func callerProtectedCorrectionParameters(request Request, endpointKind string) m
}
}
}
if endpointKind == "images.generations" || endpointKind == "images.edits" {
// The Gateway canonicalizes image output independently of the provider's
// URL/Base64 preference. Allow an explicitly supplied response_format to
// be removed only after the selected upstream rejects it as unsupported.
delete(protected, "response_format")
}
return protected
}