fix(image): repair Tuzi routing and image endpoint fallback#200
Merged
Conversation
|
@2040725155-star is attempting to deploy a commit to the ljquan's projects Team on Vercel. A member of the Team first needs to authorize it. |
✅ Deploy Preview for ai-tu ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Author
最新 CI 核对
因此当前红灯没有显示本次端点或生图修复引入新的失败。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

背景
新增供应商并选择
gpt-image-2后,图片生成可能在等待一段时间后报错:本 PR 修复从跨域请求、API 版本路径、历史 binding 到 Tuzi 多节点识别与回退的完整链路。
最终定位
使用相同 API Key 直接请求:
供应商返回 HTTP 200 和有效图片。因此 API Key、Tuzi 主站和
/v1/images/generations均正常,截图中的 404 来自项目内部路由,而不是站点不可用。实际根因包括:
binding.submitPath,旧配置可能把简化 JSON 请求发到/images/edits。default分组的简化 JSON 格式,无论文生图还是带参考图,都应使用/images/generations。sydney-ai.com或ourzhishi.top,旧逻辑只识别*.tu-zi.com,会把备用节点误判为普通 OpenAI 兼容供应商并选错 adapter。/v1的表达不一致,可能造成根路径请求或重复/v1/v1。X-Request-Id,可能因供应商未放行该自定义头而触发 CORS 预检失败。修改内容
tu-zi.com子域名。/images/generations,自动修复历史/images/editsbinding。ensure-v1:https://host+/images/generations->/v1/images/generationshttps://host/v1+/images/generations->/v1/images/generationshttps://host/v1+/v1/images/generations->/v1/images/generations/v1的模型 API Base URL。/api/pricing,不会错误追加/v1。X-Request-Id,避免跨域供应商额外的 CORS 预检失败。docs/PROVIDER_IMAGE_ENDPOINT_404_LESSONS.md,记录备用域名、历史 binding 修复、测速边界与回退规则。验证
自动化
pnpm nx typecheck drawnix通过。pnpm nx build drawnix通过。pnpm nx build web通过,包括主应用和 Service Worker 生产构建。no-explicit-anywarning。git diff --check和 API Key 精确扫描通过,敏感信息未写入源码、文档或提交。真实 API 与浏览器
/v1/images/generations返回 HTTP 200 和有效图片。gpt-image-2后生成并插入一张1254 x 1254图片。gpt-image-2,再次成功生成并插入第二张1254 x 1254图片。兼容性与风险控制
ensure-v1只由 Tuzi GPT Image adapter 显式启用。CI 说明
旧提交上的 CI 失败包含仓库基线测试环境问题和 Vercel 授权失败;Netlify deploy preview 成功。最新推送会重新触发远程检查,本 PR 的相关测试、类型检查、生产构建和真实浏览器出图均已在本地通过。