Skip to content

fix(ali): accept string usage values in task polling - #4155

Merged
Calcium-Ion merged 1 commit into
QuantumNous:mainfrom
seefs001:fix/ali-usage-int-value
Apr 9, 2026
Merged

fix(ali): accept string usage values in task polling#4155
Calcium-Ion merged 1 commit into
QuantumNous:mainfrom
seefs001:fix/ali-usage-int-value

Conversation

@seefs001

@seefs001 seefs001 commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Refactor
    • Updated internal representation of usage data fields (duration, video count, and signal-to-noise ratio) for improved alignment with upstream data handling. JSON serialization behavior remains unchanged, ensuring compatibility with existing integrations.

@coderabbitai

coderabbitai Bot commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e17d7876-8c35-40ec-b66c-b80b87ab5baa

📥 Commits

Reviewing files that changed from the base of the PR and between 78e4cb3 and 274307b.

📒 Files selected for processing (1)
  • relay/channel/task/ali/adaptor.go

Walkthrough

Three numeric fields in the AliUsage struct—Duration, VideoCount, and SR—were refactored from int types to dto.IntValue types, maintaining their JSON serialization behavior and field tags without altering the request/response control flow.

Changes

Cohort / File(s) Summary
Type Migration
relay/channel/task/ali/adaptor.go
Updated AliUsage struct fields Duration, VideoCount, and SR from int to dto.IntValue types while preserving JSON serialization tags and omitempty behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Three integers changed their coat,
From plain to wrapped—a valued note,
Duration, counts, and SR bright,
Now nestled in dto's delight,
The flow remains, the purpose clear,
A gentle refactor, nothing to fear! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating AliUsage fields to accept string values (via dto.IntValue) instead of plain integers during task polling.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Calcium-Ion
Calcium-Ion merged commit 53cf37a into QuantumNous:main Apr 9, 2026
1 check passed
liuyaaixxa pushed a commit to liuyaaixxa/xnew-api that referenced this pull request Apr 23, 2026
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.

阿里视频任务轮询在使用可灵模型时上游返回 usage.SR 为字符串会导致解析失败

2 participants