Skip to content

feat: improve Image API error diagnostics#123

Open
yijie777 wants to merge 1 commit into
CookSleep:mainfrom
yijie777:feat/image-api-error-diagnostics
Open

feat: improve Image API error diagnostics#123
yijie777 wants to merge 1 commit into
CookSleep:mainfrom
yijie777:feat/image-api-error-diagnostics

Conversation

@yijie777

@yijie777 yijie777 commented Jul 22, 2026

Copy link
Copy Markdown

概述

  • 在 Image API 错误信息中展示 HTTP 状态、服务商返回的错误信息和请求标识
  • 对 HTML 网关错误页面进行摘要提取,避免直接展示原始 HTML 内容
  • 附加经过安全处理的请求诊断信息,包括模型、尺寸、质量、代理状态和请求耗时
  • 对 Bearer Token 和 OpenAI 格式的 API Key 进行脱敏处理
  • 当成功响应不是有效 JSON 时,展示响应类型和限制长度后的响应摘要

测试

  • npm test——19 个测试文件、244 项测试全部通过
  • npm run build
  • git diff --check

变更范围

本 PR 仅包含通用的 Image API 错误诊断功能,不包含特定部署环境的代理配置,也不包含特定服务商的模型
预设功能。
image

Include HTTP metadata, request identifiers, safe response previews, and request context when image generation fails.
@CookSleep

Copy link
Copy Markdown
Owner

额……请问这个的作用是?

@yijie777

Copy link
Copy Markdown
Author

报错信息给得更清楚了,方便看看到底是哪一环出了问题(主要用于排查第三方中转和 API 代理的生图故障)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants