Repository navigation
fix(video): route and price Seedance by provider - #45
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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".
| // 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")) |
There was a problem hiding this comment.
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 👍 / 👎.
| if ( | ||
| props.model.video_provider !== 'lxmone-seedance' && | ||
| isSeedanceModel(props.model.model_name || '') | ||
| ) { | ||
| return <SeedanceApiDocs modelName={props.model.model_name || ''} /> |
There was a problem hiding this comment.
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 👍 / 👎.
| for _, ability := range abilities[1:] { | ||
| candidatePriority := int64(0) | ||
| if ability.Priority != nil { | ||
| candidatePriority = *ability.Priority | ||
| } | ||
| if candidatePriority > priority || candidatePriority == priority && ability.ChannelId < chosen.ChannelId { |
There was a problem hiding this comment.
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 👍 / 👎.
Important
📝 变更描述 / 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
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。📸 运行证明 / 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.