fix(gemini): 移除空返图占位并暴露失败原因
Gemini 图片响应未包含可提取资源时,不再返回伪造占位图,改为非重试失败并保留安全拦截、候选结束状态和上游错误等结构化诊断。\n\n同步将诊断写入 HTTP 错误、任务结果、attempt 指标和日志,确保任务失败时不结算,并补充单元及 PostgreSQL 验收测试。\n\n验证:gofmt、go test ./... -count=1、go vet ./...、迁移安全检查、pnpm openapi。
This commit is contained in:
@@ -258,6 +258,9 @@ func failureMetrics(err error, simulated bool) (string, map[string]any, time.Tim
|
||||
metrics["error"] = err.Error()
|
||||
metrics["errorCategory"] = info.Category
|
||||
metrics["retryable"] = retryable
|
||||
if details := clients.ErrorDetails(err); len(details) > 0 {
|
||||
metrics["errorDetails"] = details
|
||||
}
|
||||
if detail := rateLimitFailureDetail(err); len(detail) > 0 {
|
||||
metrics["rateLimit"] = detail
|
||||
}
|
||||
@@ -288,6 +291,9 @@ func buildFailureResult(code string, message string, requestID string, err error
|
||||
if requestID != "" {
|
||||
errorPayload["requestId"] = requestID
|
||||
}
|
||||
if details := clients.ErrorDetails(err); len(details) > 0 {
|
||||
errorPayload["details"] = details
|
||||
}
|
||||
if detail := rateLimitFailureDetail(err); len(detail) > 0 {
|
||||
errorPayload["rateLimit"] = detail
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user