Skip to content

feat(video): add Wan 3.0 resolution pricing and request validation - #42

Merged
lingozhi merged 1 commit into
mainfrom
codex/wan3-lxmone
Sep 7, 2026
Merged

lingozhi merged 1 commit into
mainfrom
codex/wan3-lxmone

Conversation

@lingozhi

@lingozhi lingozhi commented Sep 7, 2026

Copy link
Copy Markdown
Owner

⚠️ 提交说明 / PR Notice

Important

  • 请提供人工撰写的简洁摘要,避免直接粘贴未经整理的 AI 输出。

📝 变更描述 / Description

Add the four lxmone Wan 3.0 video models to the OpenAI video adapter. Normalize duration and resolution aliases before billing and send those same values upstream, preserving reference media and explicit false flags. Reject conflicting aliases, invalid media layouts, multiple outputs, and durations outside 2–30 seconds.

Use the configured 720p per-second price as the base and expose matching 480p/720p/1080p prices in the public catalog. At a $0.30 base, the three output-second prices are $0.25/$0.30/$0.35, before existing group multipliers. Treat upstream archiving as an in-progress task.

This change was AI-assisted. Production channel configuration and site API validation are tracked separately from the code change.

🚀 变更类型 / Type of change

  • 🐛 Bug 修复 (Bug fix)
  • ✨ 新功能 (New feature)
  • ⚡ 性能优化 / 重构 (Refactor)
  • 📝 文档更新 (Documentation)

🔗 关联任务 / Related Issue

  • User-requested Wan 3.0 integration; no issue.

✅ 提交前检查项 / Checklist

  • 人工确认: 我已亲自整理并撰写此描述,没有直接粘贴未经处理的 AI 输出。
  • 非重复提交: 我已搜索现有的 Issues 与 PRs,确认不是重复提交。
  • Bug fix 说明: 若此 PR 标记为 Bug fix,我已提交或关联对应 Issue。
  • 变更理解: 已检查验证、计费、转发和任务状态链路。
  • 范围聚焦: 本 PR 未包含任何与当前任务无关的代码改动。
  • 本地验证: 已在本地运行并通过相关测试。
  • 安全合规: 代码中无敏感凭据,使用现有配额饱和和失败退款流程。

📸 运行证明 / Proof of Work

  • Passed go test ./relay/channel/task/sora ./common ./model.
  • Passed go test ./relay ./controller -run 'Task|Video|Sora|Wan' -count=1.
  • Passed go vet ./relay/channel/task/sora ./model and git diff --check.
  • Broader go vet ./common reports existing mutex-copy warnings in custom-event.go and an IPv6 address-format warning in email_test.go.
  • Regression coverage asserts billable duration/resolution match upstream payloads; exact three-tier costs; default normalization; explicit false preservation; invalid aliases, bounds, and media layouts; and archiving status.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-07T09:01:05.790467Z 071ad78 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lingozhi
lingozhi merged commit f486f6c into main Sep 7, 2026
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 071ad78652

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +97 to +98
if common.WanVideoResolutionRatios(info.OriginModelName) != nil {
return validateWanVideoRequest(c, info)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Apply Wan handling after model mapping

When a channel exposes an alias mapped to a Wan 3.0 model, this check sees only the public alias because RelayTaskSubmit calls ModelMappedHelper after validation and later restores OriginModelName before billing. The request therefore falls through to the generic validator, and EstimateBilling and BuildRequestBody also miss their Wan branches; for example, an aliased 1080p request is billed at the default resolution ratio, while durations above 30 seconds are accepted. Detect the effective mapped model before validation or otherwise carry the Wan protocol classification through validation, billing, and forwarding.

AGENTS.md reference: AGENTS.md:L110-L110

Useful? React with 👍 / 👎.

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.

1 participant