fix(media): 统一图片结果 URL 化并限制同步 Base64

将上游 URL 直接持久化,内联媒体经对象存储后仅保留 URL 与内部定位元数据;异步轮询、任务详情和幂等重放统一使用零对象读取的 URL 投影,并增加 64KiB 响应门禁。

OpenAI 图片接口接受 url 与 b64_json,同步 Base64 限制为 20MiB 和每 Pod 2 并发;新增历史结果迁移清零门禁、结果指标和 API GOMEMLIMIT。

验证:API go test ./...、go vet、聚焦 race、pnpm openapi、pnpm lint/test/build、迁移安全检查与 docker compose config 均通过。
This commit is contained in:
2026-08-05 18:15:06 +08:00
parent f9b945e4aa
commit b13392ef50
22 changed files with 1367 additions and 176 deletions
@@ -22,6 +22,11 @@ func publicGatewayTask(task store.GatewayTask) store.GatewayTask {
task.Attempts = append([]store.TaskAttempt(nil), task.Attempts...)
for index := range task.Attempts {
attempt := &task.Attempts[index]
// User-facing task details expose the canonical task result. Attempt
// snapshots can duplicate large input media or retain raw provider output,
// so keep them available only on dedicated administrative surfaces.
attempt.RequestSnapshot = nil
attempt.ResponseSnapshot = nil
if attempt.ErrorCode == "" && attempt.ErrorMessage == "" {
continue
}