将图像和视频的默认 HTTP/轮询超时分别提高到 20 分钟和 30 分钟。媒体任务超时后直接失败,不再重试、切换客户端或标记为 upstream_submission_unknown。OpenAI 图像端点遇到上游明确拒绝 response_format 时自动移除并缓存兼容结论。 验证:go test ./... -count=1;go vet ./...;gofmt;相关 Shell bash -n、ShellCheck 与发布脚本回归测试。
19 lines
734 B
Go
19 lines
734 B
Go
package runner
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/easyai/easyai-ai-gateway/apps/api/internal/clients"
|
|
)
|
|
|
|
func TestTimeoutDoesNotBecomeUpstreamSubmissionUnknown(t *testing.T) {
|
|
timeoutErr := &clients.ClientError{Code: "timeout", Message: "upstream request timed out", Retryable: false}
|
|
if shouldClassifyUpstreamSubmissionUnknown(false, "submitting", timeoutErr) {
|
|
t.Fatal("a definitive provider timeout must remain timeout instead of manual-review unknown")
|
|
}
|
|
networkErr := &clients.ClientError{Code: "network", Message: "connection reset", Retryable: true}
|
|
if !shouldClassifyUpstreamSubmissionUnknown(false, "submitting", networkErr) {
|
|
t.Fatal("an ambiguous non-timeout disconnect must retain manual-review protection")
|
|
}
|
|
}
|