merge: 合并CosyVoice调试日志到develop(排查418错误)
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 9s
CI/CD Pipeline / Production Browser E2E (push) Failing after 1613h57m44s
CI/CD Pipeline / Deploy Production (push) Failing after 1613h57m46s
CI/CD Pipeline / Staging API Integration Tests (push) Failing after 1613h57m46s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 1613h57m46s
CI/CD Pipeline / Build Production Runtime Images (push) Failing after 1613h57m48s
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (push) Failing after 1613h57m48s
CI/CD Pipeline / Frontend Lint (push) Has been skipped

This commit is contained in:
用户CI Test
2026-07-11 09:31:34 +08:00
+22
View File
@@ -589,6 +589,20 @@ class CosyVoiceService:
"Content-Type": "application/json",
}
# DEBUG: 打印完整请求信息,用于排查418错误
import json as json_lib
safe_headers = {k: v for k, v in headers.items()}
if "Authorization" in safe_headers:
token = safe_headers["Authorization"]
if len(token) > 20:
safe_headers["Authorization"] = token[:13] + "..." + token[-4:]
logger.info(
"[CosyVoice Debug] 请求详情: "
"method=%s, url=%s, headers=%s, body=%s",
method, url, safe_headers,
json_lib.dumps(json, ensure_ascii=False) if json else "None",
)
last_error: Optional[Exception] = None
for attempt in range(self.MAX_RETRIES):
@@ -601,6 +615,14 @@ class CosyVoiceService:
timeout=timeout,
)
# DEBUG: 打印响应状态和完整响应体
logger.info(
"[CosyVoice Debug] 响应详情: "
"status=%d, body=%s",
response.status_code,
response.text[:2000], # 最多2000字符,避免日志过大
)
# 处理响应
if response.status_code == 200:
return response.json()