fix: stabilize puzzle vector engine asset generation
This commit is contained in:
@@ -341,6 +341,8 @@ fn record_external_api_failure_otlp(failure: &ExternalApiFailureDraft) {
|
||||
prompt_chars = failure.prompt_chars,
|
||||
reference_image_count = failure.reference_image_count,
|
||||
image_model = failure.image_model,
|
||||
request_id = %failure.request_id.as_deref().unwrap_or_default(),
|
||||
error_source = %failure.error_source.as_deref().unwrap_or_default(),
|
||||
error = %failure.error_message,
|
||||
"外部 API 调用失败"
|
||||
);
|
||||
@@ -394,6 +396,10 @@ mod tests {
|
||||
)
|
||||
.with_status_code(Some(429))
|
||||
.with_retryable(true)
|
||||
.with_error_source(Some(
|
||||
"client error (SendRequest) -> connection closed before message completed"
|
||||
.to_string(),
|
||||
))
|
||||
.with_latency_ms(Some(1234))
|
||||
.with_prompt_chars(Some(88))
|
||||
.with_reference_image_count(Some(2))
|
||||
@@ -414,6 +420,10 @@ mod tests {
|
||||
assert_eq!(metadata["promptChars"], 88);
|
||||
assert_eq!(metadata["referenceImageCount"], 2);
|
||||
assert_eq!(metadata["imageModel"], "gpt-image-2-all");
|
||||
assert_eq!(
|
||||
metadata["errorSource"],
|
||||
"client error (SendRequest) -> connection closed before message completed"
|
||||
);
|
||||
assert!(matches!(metadata["occurredAt"], Value::String(_)));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user