Skip to content

fix(video): route and price Seedance by provider - #45

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

lingozhi merged 1 commit into
mainfrom
codex/lxmone-seedance-routing

Conversation

@lingozhi

@lingozhi lingozhi commented Sep 7, 2026

Copy link
Copy Markdown
Owner

⚠️ 提交说明 / PR Notice

Important

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

📝 变更描述 / Description

Live site testing found seedance-2.5 rejected at the routing layer before reaching the new adaptor. Resolve supported paths by provider in direct, cached, and database selection. Preserve Argolink paths while allowing Lxmone /v1/videos. Display primary-channel resolution prices and protocol, retain public task/model aliases, and keep new model names eligible for duration settlement.

AI-assisted implementation, manually reviewed. Existing Argolink prices are unchanged. Production tests submitted the other three models once each; the rejected 2.5 request incurred no charge and will be retried after deployment.

🚀 变更类型 / Type of change

  • 🐛 Bug 修复 (Bug fix) - 请关联对应 Issue,避免将设计取舍、理解偏差或预期不一致直接归类为 bug
  • ✨ 新功能 (New feature) - 重大特性建议先通过 Issue 沟通
  • ⚡ 性能优化 / 重构 (Refactor)
  • 📝 文档更新 (Documentation)

🔗 关联任务 / Related Issue

✅ 提交前检查项 / Checklist

  • 人工确认: 我已亲自整理并撰写此描述,没有直接粘贴未经处理的 AI 输出。
  • 非重复提交: 我已搜索现有的 Issues 与 PRs,确认不是重复提交。
  • Bug fix 说明: 若此 PR 标记为 Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。
  • 变更理解: 我已理解这些更改的工作原理及可能影响。
  • 范围聚焦: 本 PR 未包含任何与当前任务无关的代码改动。
  • 本地验证: 已在本地运行并通过测试或手动验证,维护者可以据此复核结果。
  • 安全合规: 代码中无敏感凭据,且符合项目代码规范。

📸 运行证明 / Proof of Work

Passed: go test ./model ./middleware ./controller ./relay/channel/task/sora ./common; focused billing-context regression; go vet ./relay/channel/task/sora ./model ./middleware ./controller; frontend typecheck, affected-file oxlint/oxfmt, and production build. Tests cover cached/database provider routing, primary-provider prices with old-channel reactivation, and duration settlement.

@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-07T10:04:34.975298Z be80b52 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 ad6cc7e 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: be80b52537

ℹ️ 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 thread common/lxmone_seedance.go
// and database-backed selection. Unrelated models retain existing routing.
func SeedanceRequestPathSupported(baseURL, model, path string) bool {
if IsLxmoneSeedance(baseURL, model) {
return path == "/v1/videos" || (strings.HasPrefix(path, "/v1/videos/") && !strings.HasSuffix(path, "/remix"))

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 Exclude the Seedance submit route from Lxmone's poll prefix

When Lxmone and Argolink both expose a shared Seedance model, /v1/videos/generations satisfies this prefix test and can therefore select a higher-priority Lxmone channel. That route represents the Argolink contract—whose valid requests may contain fields such as n: 1—but validateLxmoneSeedanceRequest rejects those fields, so requests that the Argolink channel could serve fail locally instead. Exclude the literal generations path from this Lxmone branch rather than treating it like /v1/videos/{task_id}.

AGENTS.md reference: AGENTS.md:L114-L120

Useful? React with 👍 / 👎.

Comment on lines +1303 to 1307
if (
props.model.video_provider !== 'lxmone-seedance' &&
isSeedanceModel(props.model.model_name || '')
) {
return <SeedanceApiDocs modelName={props.model.model_name || ''} />

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep Lxmone API documentation available

When Lxmone is the only enabled ability, the backend now reports only openai-video, but common/endpoint_defaults.go has no mapping for that endpoint type. This condition consequently bypasses SeedanceApiDocs, endpoint resolution filters out the unmapped endpoint, and CodeSamplesSection returns null, leaving the model's API tab without any create or polling example. Add an Lxmone-specific documentation path and endpoint mapping before suppressing the existing docs.

Useful? React with 👍 / 👎.

Comment on lines +20 to +25
for _, ability := range abilities[1:] {
candidatePriority := int64(0)
if ability.Priority != nil {
candidatePriority = *ability.Priority
}
if candidatePriority > priority || candidatePriority == priority && ability.ChannelId < chosen.ChannelId {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Select catalog pricing within each enabled group

If providers for the same model are assigned to different groups, this chooses one provider across the combined ability slice solely by global priority/channel ID, whereas runtime routing first filters abilities by the request's group. The resulting single VideoProvider and resolution-price table is then advertised for every EnableGroup, so a group whose only usable provider is Lxmone can be shown Argolink pricing, or vice versa. Provider-specific tiers should only be published when selection is consistent across groups, or should be calculated per group.

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