Preserve ModelAPI Seedance tasks returned as HTTP 201 - #693
Merged
Conversation
Constraint: Production ModelAPI returns 201 Created for successful tasks Rejected: Accept every 2xx in the shared relay | would change all async providers Confidence: high Scope-risk: narrow Directive: Keep status normalization provider-local unless the shared task contract is deliberately redesigned Tested: Production log evidence and spec self-review Not-tested: No additional paid production generation
Constraint: ModelAPI returns 201 Created for successful POST /v1/tasks submissions Rejected: Accept every 2xx response in the shared task relay | would alter all async providers Confidence: high Scope-risk: narrow Directive: Keep provider-specific success-status normalization inside the adaptor Tested: temporary local 201/500 HTTP regression, ModelAPI package, task relay suite, relay compile, go vet, diff checks Not-tested: no second paid production generation; mock regression removed before commit per operator directive
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.
📝 变更描述 / Description
生产上的 ModelAPI Seedance 创建接口会以 HTTP 201 Created 表示任务创建成功。公共异步任务 Relay 在调用 provider 的 DoResponse 前只接受 HTTP 200,因此已成功生成的视频会被误判为 fail_to_fetch_task,任务 ID 也不会被 Flatkey 保存。
本 PR 只在 ModelAPI Seedance 适配器内把创建响应的 201 归一化为 200。响应体、error、原有 200、4xx/5xx、proxy 处理、计费、轮询、素材入库、Google 下载代理与白标逻辑均保持不变。公共 Relay 的严格状态码契约不放宽。
该逻辑是请求局部状态转换,多节点之间无共享状态或协调要求。
🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
🔎 生产证据 / Root cause evidence
✅ 提交前检查项 / Checklist
📸 运行证明 / Proof of Work
go test ./relay/channel/task/modelapiseedance -count=1:PASS。go test ./relay/channel/task/... -count=1:PASS。go test ./relay/... -run '^$':PASS。go vet ./relay/channel/task/modelapiseedance:PASS。git diff --check:PASS。🚢 部署建议 / Deployment
/v1/videosprovider relay 路径。https://router.flatkey.ai/api/status返回 200;不做付费生成 smoke。