Skip to content

feat(video): 接入 Agnes Video 2.5 与 Token Plan Flash - #820

Open
xyh202131 wants to merge 5 commits into
1024XEngineer:mainfrom
xyh202131:feat/agnes-video-25
Open

feat(video): 接入 Agnes Video 2.5 与 Token Plan Flash#820
xyh202131 wants to merge 5 commits into
1024XEngineer:mainfrom
xyh202131:feat/agnes-video-25

Conversation

@xyh202131

@xyh202131 xyh202131 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Closes #821

变更内容

  • 接入 Agnes Video 2.5 及 Token Plan 可用的 Agnes Video 2.5 Flash,按官方合同提交、轮询并下载成片。
  • Agnes 使用独立服务地址和服务端密钥,不复用 Modelink/Kling 凭证。
  • Token Plan 生产主模型使用 agnes-video-2.5-flash;限流或建单前不可达时,安全重试后自动降级到 Kling。
  • 不硬编码按秒美元成本,避免把 Token Plan 订阅额度误记为现金支出。
  • 保留现有 Kling、Veo 的建单、轮询和下载行为。

部署配置

AI_VIDEO_MODEL=agnes-video-2.5-flash
AI_VIDEO_FALLBACKS=kling-v2-5-turbo,kling-v2-6
AI_VIDEO_AGNES_BASE_URL=https://apihub.agnes-ai.com/v1
AI_VIDEO_AGNES_API_KEY=<仅在服务端配置>

验证

  • uv run ruff check .
  • uv run lint-imports:2 kept,0 broken
  • OpenAPI 导出无漂移
  • uv run pytest -q:1844 passed,14 skipped
  • 新增标准版与 Flash 协议、凭证隔离、下载及自动降级测试

@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
windup Ignored Ignored Preview Aug 27, 2026 8:01am

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown

✅ 此 PR 已关联 issue,之前的提醒已自动标记为已解决。

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.87671% with 25 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...windup_framework/providers/protocol/agnes_video.py 83.33% 16 Missing ⚠️
...s/framework/src/windup_framework/providers/sufy.py 69.56% 7 Missing ⚠️
...es/framework/src/windup_framework/gateway/video.py 91.30% 2 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #820      +/-   ##
==========================================
+ Coverage   86.52%   91.57%   +5.04%     
==========================================
  Files         293      188     -105     
  Lines       21902    12029    -9873     
  Branches     3329        0    -3329     
==========================================
- Hits        18951    11015    -7936     
+ Misses       2021     1014    -1007     
+ Partials      930        0     -930     
Flag Coverage Δ
backend 91.57% <82.87%> (+0.01%) ⬆️
frontend ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
.../framework/src/windup_framework/config/provider.py 100.00% <100.00%> (ø)
...framework/src/windup_framework/gateway/registry.py 95.89% <ø> (ø)
...es/framework/src/windup_framework/gateway/types.py 100.00% <100.00%> (ø)
...rc/windup_framework/providers/protocol/__init__.py 100.00% <100.00%> (ø)
...es/framework/src/windup_framework/gateway/video.py 89.83% <91.30%> (+6.29%) ⬆️
...s/framework/src/windup_framework/providers/sufy.py 93.81% <69.56%> (-2.19%) ⬇️
...windup_framework/providers/protocol/agnes_video.py 83.33% <83.33%> (ø)

... and 106 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已核对 Agnes 建单/轮询/下载协议、独立凭证、异步任务型号传递及 Kling 降级路径。独立凭证的失败后策略已处理,但现有路由熔断仍会在进入型号循环前拦截 Agnes,导致 Modelink 故障时新的主模型也不可用。

验证受限:当前环境未安装 uv/Python 依赖,无法执行测试套件;结论基于固定 SHA 差异与调用链检查。

Comment on lines +337 to +339
uses_isolated_model_credentials = (
self._registry.family_of(model) is Family.VIDEO_AGNES
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] 在路由熔断前放行独立的 Agnes 提交

这里仅在 Agnes 已经进入型号循环、提交失败后才把 OPEN_AGGREGATOR/FALLBACK_KEY 改为型号降级,但 i2v() 在此之前会先检查 aggregatorbase_url:<Modelink route> 和 key 熔断并直接失败或跳过整条 route。生产装配复用共享 _CIRCUIT,因此一次 Kling/Modelink 未达上游打开 base_url:qnaigc-primary(或全局 aggregator)后,即使 Agnes 使用完全独立的 URL/key,后续以 Agnes 为主模型的请求也不会调用 Agnes adapter;单 route 配置下会直接报错。这破坏了本 PR 的凭证/服务隔离和主模型可用性,应让 Agnes 绕过 Modelink route/key/aggregator 熔断,或为 Agnes 建立独立 route/circuit scope。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已在 1a116e7 修复:将 aggregator、base_url 与 key 的熔断判定下沉到具体型号层;Agnes 仅绕过 Modelink 共享熔断,仍受自身 model 熔断约束,Kling 等型号继续遵守原共享熔断。新增三种共享 scope 的放行测试,并验证 Agnes 失败后不会绕过熔断提交 Kling。完整后端测试 1850 passed、14 skipped,ruff、import-linter 与 diff check 均通过。

@xyh202131 xyh202131 changed the title feat(video): 接入 Agnes Video 2.5 主模型 feat(video): 接入 Agnes Video 2.5 与 Token Plan Flash Aug 27, 2026
@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

Deployment failed for project windup with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/huyan-s-projects1?upgradeToPro=build-rate-limit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

接入 Agnes Video 2.5 与 Token Plan Flash 主模型

1 participant