fix(video): NewAPI Channel 2 - 修复轮询与结果解析
创建成功后的短暂 task_not_exist 按退避策略重试,并在短期窗口耗尽后保留 running 状态,继续回查原 Provider Task ID。 补齐嵌套任务 ID 与视频结果地址解析,更新生成插件、协议文档和专项回归测试。
This commit is contained in:
1 parent
05d1bce876
commit
f4ced0ac59
13 files changed
+378
-12
No files matched your search
@@ -86,6 +86,25 @@ func TestEnrichAPICallLogReadsArkVideoUsage(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestEnrichAPICallLogPrefersNewAPIChannel2NestedTaskID(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
payload string
|
||||
}{
|
||||
{name: "snake case", payload: `{"id":"wrapper-id","data":{"task_id":"task-snake"}}`},
|
||||
{name: "camel case", payload: `{"id":"wrapper-id","data":{"taskId":"task-camel"}}`},
|
||||
}
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
log := &model.ApiCallLog{Capability: "video", Path: "/v1/video/generations"}
|
||||
(&Service{}).EnrichAPICallLog(log, []byte(test.payload))
|
||||
if !strings.HasPrefix(log.ProviderRequestID, "task-") {
|
||||
t.Fatalf("ProviderRequestID = %q, want nested upstream task ID", log.ProviderRequestID)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestEnrichAPICallLogKeepsUserFacingAndUpstreamFailureDetails(t *testing.T) {
|
||||
log := &model.ApiCallLog{
|
||||
Status: model.ApiCallStatusFailed,
|
||||
|
||||
Reference in new issue
Block a user