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:
@@ -442,6 +442,25 @@ func TestResolveCandidateFailureStopsAfterDownstreamStarts(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestResolveCandidateFailureStopsTerminalMediaTimeout(t *testing.T) {
|
||||
decision := resolveCandidateFailure(resolveCandidateFailureInput{
|
||||
RunnerPolicy: store.RunnerPolicy{
|
||||
Status: "active",
|
||||
FailoverPolicy: map[string]any{"enabled": true},
|
||||
},
|
||||
Candidate: store.RuntimeModelCandidate{ModelRetryPolicy: map[string]any{"enabled": true, "maxAttempts": 3}},
|
||||
Err: &clients.ClientError{Code: "timeout", Message: "upstream request timed out", Retryable: true},
|
||||
ClientAttempt: 1,
|
||||
MaxClientAttempts: 3,
|
||||
HasNextCandidate: true,
|
||||
TaskKind: "images.edits",
|
||||
})
|
||||
|
||||
if decision.Route != "stop" || decision.Effect != "none" || decision.Reason != "media_timeout_terminal" {
|
||||
t.Fatalf("media timeout must stop without retry or rotation, got %+v", decision)
|
||||
}
|
||||
}
|
||||
|
||||
func TestResolveCandidateFailureLegacyPolicyPrecedence(t *testing.T) {
|
||||
candidate := store.RuntimeModelCandidate{
|
||||
DegradePolicy: map[string]any{
|
||||
|
||||
Reference in New Issue
Block a user