feat: support sub2api async image tasks#41
Open
Wangnov wants to merge 5 commits into
Open
Conversation
Wangnov
marked this pull request as ready for review
July 24, 2026 12:25
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.
结论与兼容边界
这次把“服务品牌预设”和“实际图片传输协议”拆成了两层,避免把产品名误当成兼容保证:
/v1/images/generations、/v1/images/editsnew-api预设,但不伪装成专用 runtime adaptersub2api-asynctransportsub2api 异步接口已按当前上游 Asynchronous Image Tasks 文档与源码核对:
POST /v1/images/generations/asyncPOST /v1/images/edits/asyncGET /v1/images/tasks/{task_id}实现
preset、image_transport、轮询间隔与超时;旧配置默认继续使用openai-sync安全与计费语义
POST不自动重试,避免“服务端已受理、响应丢失”时重复创建和计费GET的网络错误、429 与 5xx 做 timeout-bound 重试Retry-After和用户配置共同决定轮询间隔,用户配置始终是频率下限api_base同源,Bearer token 不会发送到跨源地址验证
cargo test --workspace:core 154 passed / 1 ignored(需真实 R2 凭证),App 9、runtime 7、Web 7cargo clippy --workspace --all-targets -- -D warningscargo fmt --all -- --checkgit diff --checknpm test:16 files / 101 testsnpm run typechecknpm run buildcodex review --uncommitted:未发现明确且可操作的正确性问题截图
使用限制
image_storageCI
scripts/release/prepare.sh在 GitHub Actionscandidatejob 通过candidate、frontend、relay、plan全部通过Closes #40