fix(#2183): 信任链真·现场t2i + preheat接线分步任务 + portrait_intercept降级纯t2v + LLM timeout调大 #2183

Open
xiaoxia wants to merge 0 commits from fix/trust-chain-real-preheat-and-timeout into develop
Owner

问题

人像E2E失败,信任链3处断链:

  1. _start_trust_chain_preheat 只在旧合并pipeline调用,新分步task run_viral_video_analyze / run_viral_video_generate_copy 没接 → pre_trusted_images永远None
  2. _step_render打『现场跑信任链』日志但实际不跑t2i,直接传原图 → 真人照直接送Seedance
  3. portrait_intercept(HTTP 400)4xx不重试,也无『去掉参考图纯t2v』降级 → 必失败

额外问题:pro chat实测1500tok输出需75.8s,_step_script_generation硬编码45s必超时走兜底,job1超5分钟。

修改

信任链3处修复

  1. 接线preheat到分步task:run_viral_video_analyze VLM完成后立即启动 _start_trust_chain_preheat daemon,与后续阶段并行(与旧pipeline同样逻辑)
  2. 真·现场t2i:_step_render 预热不可用时同步调用 preheat_trust_chain(portrait_descs, timeout=120),成功则用AI人像URL替换原图传Seedance
  3. 400 portrait_intercept自动降级纯t2v:ai_client.video_generation ratio兜底后检查是否portrait拦截,是则移除所有image/audio/video参考,只留text重试一次纯文生视频

三层兜底:后台预热(正常路径)→ 现场同步t2i(预热未完成/失败)→ 400降级纯t2v(最后保底),保证人像链路必出片。

LLM timeout调大

  • _step_script_generation:fast-first/fast-retry 45→90s,pro-fallback 60→120s(实测pro长输出75s)
  • _step_intent_parsing:45→60s
  • _step_review:30→45s
  • generate_copy celery时限:soft=360→600s, hard=420→660s(三级重试最坏90+90+120+intent60+review45≈405s)

E2E目标

  • VLM单次pro ≤60s(实测25-50s)
  • intent+script单次pro ≤90s(不再超时走三级重试)
  • 人像图:VLM输出portrait_prompt → preheat daemon启动 → render时pre_trusted已就绪 → Seedance收到AI人像URL → 人物相似度>85%,无50411
  • 商品图(非人像):VLM输出『无人像』→ preheat跳过 → render直接原图走first_frame/omni_ref

关联

  • 依赖 #2180/#2181/#2182(timeout初调、lite默认关闭、fast_model默认pro)已合入
  • staging ENV已持久化(DOUBAO_TIMEOUT=45, MAX_RETRIES=1, USE_LITE=false, FAST_MODEL=pro)
## 问题 人像E2E失败,信任链3处断链: 1. `_start_trust_chain_preheat` 只在旧合并pipeline调用,新分步task `run_viral_video_analyze` / `run_viral_video_generate_copy` 没接 → pre_trusted_images永远None 2. `_step_render`打『现场跑信任链』日志但实际不跑t2i,直接传原图 → 真人照直接送Seedance 3. portrait_intercept(HTTP 400)4xx不重试,也无『去掉参考图纯t2v』降级 → 必失败 额外问题:pro chat实测1500tok输出需75.8s,_step_script_generation硬编码45s必超时走兜底,job1超5分钟。 ## 修改 ### 信任链3处修复 1. **接线preheat到分步task**:`run_viral_video_analyze` VLM完成后立即启动 `_start_trust_chain_preheat` daemon,与后续阶段并行(与旧pipeline同样逻辑) 2. **真·现场t2i**:`_step_render` 预热不可用时同步调用 `preheat_trust_chain(portrait_descs, timeout=120)`,成功则用AI人像URL替换原图传Seedance 3. **400 portrait_intercept自动降级纯t2v**:`ai_client.video_generation` ratio兜底后检查是否portrait拦截,是则移除所有image/audio/video参考,只留text重试一次纯文生视频 三层兜底:后台预热(正常路径)→ 现场同步t2i(预热未完成/失败)→ 400降级纯t2v(最后保底),保证人像链路必出片。 ### LLM timeout调大 - `_step_script_generation`:fast-first/fast-retry 45→90s,pro-fallback 60→120s(实测pro长输出75s) - `_step_intent_parsing`:45→60s - `_step_review`:30→45s - `generate_copy` celery时限:soft=360→600s, hard=420→660s(三级重试最坏90+90+120+intent60+review45≈405s) ## E2E目标 - VLM单次pro ≤60s(实测25-50s) - intent+script单次pro ≤90s(不再超时走三级重试) - 人像图:VLM输出portrait_prompt → preheat daemon启动 → render时pre_trusted已就绪 → Seedance收到AI人像URL → 人物相似度>85%,无50411 - 商品图(非人像):VLM输出『无人像』→ preheat跳过 → render直接原图走first_frame/omni_ref ## 关联 - 依赖 #2180/#2181/#2182(timeout初调、lite默认关闭、fast_model默认pro)已合入 - staging ENV已持久化(DOUBAO_TIMEOUT=45, MAX_RETRIES=1, USE_LITE=false, FAST_MODEL=pro)
xiaoxia added 1 commit 2026-10-04 21:38:54 +08:00
fix(#2183): 信任链真·现场t2i+preheat接线+portrait_intercept降级纯t2v+timeout调大
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 1s
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 8s
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 20s
CI/CD Pipeline / PR Build Web Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 1m20s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m44s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 5m35s
AI Code Review / AI Code Review (pull_request) Successful in 10m19s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 9m26s
CI/CD Pipeline / Unit Tests (pull_request) Has been cancelled
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Style (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Security (pull_request) Has been cancelled
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Has been cancelled
PR Automation / Auto Merge on CI Green + Approved (pull_request) Has been cancelled
44bd96b148
- 信任链3处断链修复:
  1. run_viral_video_analyze VLM完成后立即启动_start_trust_chain_preheat(后台daemon与文案阶段并行)
  2. _step_render 预热不可用时真·同步调用Seedream t2i(而非打假日志直接传原图),120s超时
  3. ai_client.video_generation遇到portrait_intercept 400时自动移除所有参考图降级纯t2v重试一次
- LLM timeout调大(实测pro 1500tok输出需75.8s):
  - _step_script_generation: fast-first/fast-retry 45→90s, pro-fallback 60→120s
  - _step_intent_parsing: 45→60s
  - _step_review: 30→45s
- generate_copy celery时限放宽:soft=360→600s, hard=420→660s(三级重试最坏~405s)
- 三层兜底:后台预热→现场t2i→400纯t2v,保证人像链路必出片

🚀 预览环境已部署

项目 详情
PR号 #2183
预览链接 https://pr-2183.preview.xiaoxiajianji.com
API环境 staging

💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。

🔄 每次提交新代码后预览环境会自动更新。

🗑️ PR 关闭或合并后,预览环境会自动清理。

🚀 **预览环境已部署** | 项目 | 详情 | |------|------| | PR号 | #2183 | | 预览链接 | [https://pr-2183.preview.xiaoxiajianji.com](https://pr-2183.preview.xiaoxiajianji.com) | | API环境 | staging | > 💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。 > > 🔄 每次提交新代码后预览环境会自动更新。 > > 🗑️ PR 关闭或合并后,预览环境会自动清理。
auto-approve-bot added 1 commit 2026-10-04 21:51:20 +08:00
style: auto-format with black + isort + ruff + prettier [skip ci-format-check]
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 2s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 2s
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / PR Build Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 54s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 1m50s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 2m33s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m0s
AI Code Review / AI Code Review (pull_request) Successful in 7m4s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 9m59s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 12m57s
CI/CD Pipeline / Validate - Style (pull_request) Successful in 13m14s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 11m4s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 19m21s
CI/CD Pipeline / Validate - Security (pull_request) Successful in 26m10s
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / CI Gate (pull_request) Successful in 1s
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
5548e78eee
Some checks are pending
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 2s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 2s
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / PR Build Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 54s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 1m50s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 2m33s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m0s
AI Code Review / AI Code Review (pull_request) Successful in 7m4s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 9m59s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 12m57s
CI/CD Pipeline / Validate - Style (pull_request) Successful in 13m14s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 11m4s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 19m21s
CI/CD Pipeline / Validate - Security (pull_request) Successful in 26m10s
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / CI Gate (pull_request) Successful in 1s
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
This branch is already included in the target branch. There is nothing to merge.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/trust-chain-real-preheat-and-timeout:fix/trust-chain-real-preheat-and-timeout
git checkout fix/trust-chain-real-preheat-and-timeout
Sign in to join this conversation.