Skip to content

feat(ali): add Happy Horse 1.0 video model support - #4507

Closed
wanghualoong wants to merge 3 commits into
QuantumNous:mainfrom
wanghualoong:feat/happyhorse-1.0-support
Closed

wanghualoong wants to merge 3 commits into
QuantumNous:mainfrom
wanghualoong:feat/happyhorse-1.0-support

Conversation

@wanghualoong

@wanghualoong wanghualoong commented Apr 28, 2026 •

Copy link
Copy Markdown

Summary

Add support for Alibaba Cloud Bailian Happy Horse 1.0 video generation models in the ali channel adaptor.

Happy Horse 1.0 is a video generation model on Alibaba Cloud Bailian (DashScope API) that shares the same DashScope endpoint as Wanxiang models (/api/v1/services/aigc/video-generation/video-synthesis), but uses a different request format — a media array instead of flat fields (img_url, first_frame_url, etc.).

Changes

  • Model registration: Add 4 Happy Horse model IDs to ModelList:

    • happyhorse-1.0-t2v — text-to-video
    • happyhorse-1.0-i2v — first frame image-to-video
    • happyhorse-1.0-r2v — reference images-to-video (1-9 images, use character1/character2 in prompt)
    • happyhorse-1.0-video-edit — video editing (1 video + 0-5 reference images)
  • Request format: Add AliMediaItem struct and Media field for the media array format:

    {"input": {"media": [{"type": "first_frame", "url": "..."}, {"type": "reference_image", "url": "..."}]}}
  • New parameters: Add Ratio (aspect ratio for t2v/r2v) and AudioSetting (audio control for video-edit: auto/origin) to AliVideoParameters

  • Watermark fix: Change Watermark from bool to *bool pointer type. Happy Horse API defaults watermark to true, but Go's omitempty tag silently drops false values, causing watermarks to always appear. Using *bool ensures false is serialized. This also fixes a latent bug for Wanxiang models.

  • Auto-detection: convertToAliRequest detects Happy Horse models by "happyhorse-1.0" prefix and routes to convertToHappyHorseRequest

Files changed

File Change
relay/channel/task/ali/constants.go Add 4 Happy Horse models to ModelList
relay/channel/task/ali/adaptor.go Add AliMediaItem, Media field, Ratio/AudioSetting params, *bool Watermark, convertToHappyHorseRequest method

Happy Horse parameter differences vs Wanxiang

Parameter t2v i2v r2v video-edit
ratio 16:9/9:16/1:1/4:3/3:4 N/A (follows input) 16:9/9:16/1:1/4:3/3:4 N/A
duration 3-15s 3-15s 3-15s N/A (follows input)
resolution 720P/1080P 720P/1080P 720P/1080P 720P/1080P
watermark ✅ (default: true) ✅ (default: true) ✅ (default: true) ✅ (default: true)
audio_setting N/A N/A N/A auto/origin

References

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added Happy Horse video models (t2v, i2v, r2v, video-edit).
    • Accept ordered media inputs (first_frame/reference_image/video) and a new videos array.
    • New parameters: aspect ratio, audio setting, and nullable watermark.
    • Enforced model-specific media rules and defaults for resolution, duration, and watermark.

Add support for Alibaba Cloud Bailian Happy Horse 1.0 video generation
models in the ali channel adaptor. Happy Horse uses a different request
format (media array) compared to existing Wanxiang models (flat fields).

Changes:
- Add 4 Happy Horse model IDs to ModelList: t2v, i2v, r2v, video-edit
- Add AliMediaItem struct for media array format
- Add Media field to AliVideoInput for Happy Horse requests
- Add Ratio and AudioSetting fields to AliVideoParameters
- Change Watermark from bool to *bool to fix omitempty dropping false
  (Happy Horse API defaults watermark to true, so false must be sent)
- Add convertToHappyHorseRequest method with mode-specific media mapping:
  - t2v: text-to-video (prompt only)
  - i2v: first frame image to video (media type: first_frame)
  - r2v: reference images to video (media type: reference_image, 1-9)
  - video-edit: video editing (media type: video + reference_image)
- Auto-detect Happy Horse models by "happyhorse-1.0" prefix in
  convertToAliRequest and route to the new method

The Watermark *bool change also fixes a latent bug for Wanxiang models
where watermark:false was silently dropped by Go's omitempty tag.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@coderabbitai

coderabbitai Bot commented Apr 28, 2026 •

Copy link
Copy Markdown
Contributor

Walkthrough

Adds Happy Horse video-model support to the Ali channel: new model identifiers, new media-based request types and parameters (media array, ratio, audio_setting, pointer watermark), a new conversion path convertToHappyHorseRequest, and Videos on TaskSubmitReq.

Changes

Cohort / File(s) Summary
Model Constants
relay/channel/task/ali/constants.go
Adds four Happy Horse model identifiers: happyhorse-1.0-t2v, happyhorse-1.0-i2v, happyhorse-1.0-r2v, happyhorse-1.0-video-edit.
Adaptor types & conversion
relay/channel/task/ali/adaptor.go
Introduces AliMediaItem; adds Media []AliMediaItem to AliVideoInput; extends AliVideoParameters with Ratio *string, AudioSetting *string, and changes Watermark to *bool; adds convertToHappyHorseRequest and routes happyhorse-1.0* models from convertToAliRequest; validation of media counts, resolution/duration derivation, and metadata mapping implemented; default watermark set to lo.ToPtr(false) in non-Happy-Horse path.
Task submit payload
relay/common/relay_info.go
Adds Videos []string to TaskSubmitReq JSON payload to carry additional media inputs.

Sequence Diagram(s)

sequenceDiagram
  participant Client as Client
  participant Adaptor as TaskAdaptor
  participant Ali as Ali API

  Client->>Adaptor: Submit Task (model: happyhorse-1.0-*)
  Adaptor->>Adaptor: convertToAliRequest -> detect happyhorse model
  Adaptor->>Adaptor: convertToHappyHorseRequest(build Input.Media, set Parameters, validate counts)
  Adaptor->>Ali: Send AliVideoRequest (Input.Media, Parameters)
  Ali-->>Adaptor: Response
  Adaptor-->>Client: Return result
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • creamlike1024
  • seefs001

Poem

🐰 I hopped through lines to add a media stream,
Ordered frames and videos, fit for a dream.
Ratio and audio tucked in with care,
Watermark pointers placed in their lair.
Happy Horse and rabbit — off they gleam!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 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 feature being added—Happy Horse 1.0 video model support—which is the primary focus of the PR across all modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

@coderabbitai coderabbitai 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.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@relay/channel/task/ali/adaptor.go`:
- Around line 377-390: The payload builder currently appends media without
validating cardinality, causing invalid requests; add explicit pre-checks for
isI2V, isR2V and isEdit before populating aliReq.Input.Media: for isI2V ensure
len(req.Images)==1 and return a clear error if not; for isR2V ensure 1 <=
len(req.Images) <= 9 and return an error if outside that range; for isEdit
ensure len(req.Videos)>=1 (use the first video) and 0 <= len(req.Images) <= 5,
returning errors for violations; implement these checks immediately before the
existing aliReq.Input.Media assignments (referencing isI2V, isR2V, isEdit,
req.Images, req.Videos and aliReq.Input.Media) so the function fails fast with
descriptive messages instead of sending incomplete media arrays.
- Around line 384-385: The code references req.Videos which doesn't exist on
relaycommon.TaskSubmitReq; add a Videos []string field to the TaskSubmitReq
struct and ensure request parsing/population (where TaskSubmitReq is decoded)
fills it from the incoming payload, then update usage in adaptor.go (the block
that appends to aliReq.Input.Media) to safely check len(req.Videos)>0 before
accessing req.Videos[0]; keep the field name exactly Videos and update any
JSON/tag mapping in the request parser so the new field is populated at decode
time.
- Around line 271-273: The routing check currently uses req.Model to detect
Happy Horse mode which fails when model mapping changes it; update the condition
to check upstreamModel instead of req.Model so calls like return
a.convertToHappyHorseRequest(info, upstreamModel, req) use the real provider ID;
make the identical change for the other Happy Horse detection branch (the other
conditional that triggers
convertToHappyHorseResponse/convertToHappyHorseRequest) so all Happy Horse mode
gates use upstreamModel rather than req.Model.
- Around line 56-61: The struct fields Ratio and AudioSetting in adaptor.go are
declared as non-pointer strings but are optional; change their types to *string
(and ensure assignments create string pointers) so omitempty preserves explicit
absence; update any places that construct or copy this DTO (e.g., wherever Ratio
and AudioSetting are set or forwarded) to assign pointer values (using helpers
or &value) and adjust any consumers to handle nil vs non-nil.
- Around line 401-406: The happy-path branch in the non-edit case currently only
checks req.Duration and falls back to 5s, dropping any valid req.Seconds; update
the logic in the block that sets aliReq.Parameters.Duration (inside the if
!isEdit branch) so it first uses req.Duration if >0, otherwise uses req.Seconds
if >0, and only then defaults to 5; modify the assignment around
aliReq.Parameters.Duration to reflect this precedence (referencing isEdit,
req.Duration, req.Seconds, and aliReq.Parameters.Duration).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5dce1809-decd-4c3d-89b5-95da35cb73c8

📥 Commits

Reviewing files that changed from the base of the PR and between 9f8a4ec and a1df2ea.

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

Comment thread relay/channel/task/ali/adaptor.go Resolved
Comment thread relay/channel/task/ali/adaptor.go Resolved
Comment thread relay/channel/task/ali/adaptor.go Resolved
Comment thread relay/channel/task/ali/adaptor.go Outdated
Comment on lines +384 to +385
if len(req.Videos) > 0 {
aliReq.Input.Media = append(aliReq.Input.Media, AliMediaItem{Type: "video", URL: req.Videos[0]})

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.

⚠️ Potential issue | 🔴 Critical

Compile blocker: TaskSubmitReq has no Videos field.

req.Videos is undefined for relaycommon.TaskSubmitReq, so this package does not compile. Add a Videos []string field (and request parsing support) before using it here.

🧰 Tools
🪛 golangci-lint (2.11.4)

[error] 384-384: : # github.com/QuantumNous/new-api/relay/channel/task/ali
relay/channel/task/ali/adaptor.go:384:14: req.Videos undefined (type "github.com/QuantumNous/new-api/relay/common".TaskSubmitReq has no field or method Videos)
relay/channel/task/ali/adaptor.go:385:89: req.Videos undefined (type "github.com/QuantumNous/new-api/relay/common".TaskSubmitReq has no field or method Videos)

(typecheck)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@relay/channel/task/ali/adaptor.go` around lines 384 - 385, The code
references req.Videos which doesn't exist on relaycommon.TaskSubmitReq; add a
Videos []string field to the TaskSubmitReq struct and ensure request
parsing/population (where TaskSubmitReq is decoded) fills it from the incoming
payload, then update usage in adaptor.go (the block that appends to
aliReq.Input.Media) to safely check len(req.Videos)>0 before accessing
req.Videos[0]; keep the field name exactly Videos and update any JSON/tag
mapping in the request parser so the new field is populated at decode time.

Comment thread relay/channel/task/ali/adaptor.go Resolved
- Add Videos field to TaskSubmitReq (fixes compile error)
- Use upstreamModel instead of req.Model for Happy Horse detection
  (supports model mapping)
- Change Ratio/AudioSetting to *string pointer types for consistent
  omitempty semantics
- Add media cardinality validation: i2v requires 1 image, r2v 1-9,
  video-edit requires 1 video and at most 5 images
- Handle req.Seconds fallback in duration parsing

Co-Authored-By: Claude Opus 4.6 <[email protected]>

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
relay/common/relay_info.go (1)

670-682: ⚠️ Potential issue | 🟠 Major

Videos is not wired through the task parsing path yet.

Adding the field here is only half the change. validateMultipartTaskRequest() in relay/common/relay_utils.go:81-118 never copies formData["videos"], isKnownTaskField() in relay/common/relay_utils.go:184-196 still treats videos as unknown, and ValidateMultipartDirect() in relay/common/relay_utils.go:121-182 derives action from req.HasImage(), which ignores Videos. A Happy Horse video-edit request with one video and no reference images can therefore arrive with req.Videos empty or be classified as a text-only task.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@relay/common/relay_info.go` around lines 670 - 682, TaskSubmitReq.Videos was
added but the multipart parsing and validation paths don't handle it; update
validateMultipartTaskRequest() to copy formData["videos"] into the
TaskSubmitReq, add "videos" to the known fields checked by isKnownTaskField(),
and change ValidateMultipartDirect() so action derivation (currently using
req.HasImage()) also treats videos—either add a req.HasMedia()/HasVideo() helper
or extend HasImage() to consider req.Videos so video-edit tasks with only videos
are classified and populated correctly.
♻️ Duplicate comments (1)
relay/channel/task/ali/adaptor.go (1)

389-396: ⚠️ Potential issue | 🟠 Major

Reject multiple videos for happyhorse-1.0-video-edit.

This path still accepts len(req.Videos) > 1 and silently discards req.Videos[1:] by only forwarding the first entry. The contract in this PR is exactly 1 video, so malformed requests should fail fast instead of using the wrong source asset.

♻️ Proposed fix
 	} else if isEdit {
-		if len(req.Videos) < 1 {
-			return nil, fmt.Errorf("happyhorse video-edit requires exactly 1 video")
+		if len(req.Videos) != 1 {
+			return nil, fmt.Errorf("happyhorse video-edit requires exactly 1 video, got %d", len(req.Videos))
 		}
 		if len(req.Images) > 5 {
 			return nil, fmt.Errorf("happyhorse video-edit supports at most 5 reference images, got %d", len(req.Images))
 		}
 		aliReq.Input.Media = append(aliReq.Input.Media, AliMediaItem{Type: "video", URL: req.Videos[0]})
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@relay/channel/task/ali/adaptor.go` around lines 389 - 396, The edit branch
for happyhorse-1.0-video-edit currently only checks for len(req.Videos) < 1 but
then quietly drops extra videos; update the isEdit handling so it enforces
exactly one video by returning an error when len(req.Videos) != 1 (use the same
error style/format as other checks), leaving the existing aliReq.Input.Media
append of req.Videos[0] unchanged; make the check adjacent to the isEdit branch
(referencing isEdit, req.Videos, and aliReq.Input.Media) so malformed requests
fail fast instead of silently discarding additional videos.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@relay/channel/task/ali/adaptor.go`:
- Around line 55-64: The PromptExtend field in AliVideoParameters must be
changed from bool to *bool so explicit false is preserved when marshaling;
update the struct definition to use PromptExtend *bool and ensure any code that
constructs or merges AliVideoParameters (e.g., where instances are
created/merged) initializes a default true value using lo.ToPtr(true) unless
explicitly overridden by the client so the field is non-nil by default and
client-set false is sent upstream.

---

Outside diff comments:
In `@relay/common/relay_info.go`:
- Around line 670-682: TaskSubmitReq.Videos was added but the multipart parsing
and validation paths don't handle it; update validateMultipartTaskRequest() to
copy formData["videos"] into the TaskSubmitReq, add "videos" to the known fields
checked by isKnownTaskField(), and change ValidateMultipartDirect() so action
derivation (currently using req.HasImage()) also treats videos—either add a
req.HasMedia()/HasVideo() helper or extend HasImage() to consider req.Videos so
video-edit tasks with only videos are classified and populated correctly.

---

Duplicate comments:
In `@relay/channel/task/ali/adaptor.go`:
- Around line 389-396: The edit branch for happyhorse-1.0-video-edit currently
only checks for len(req.Videos) < 1 but then quietly drops extra videos; update
the isEdit handling so it enforces exactly one video by returning an error when
len(req.Videos) != 1 (use the same error style/format as other checks), leaving
the existing aliReq.Input.Media append of req.Videos[0] unchanged; make the
check adjacent to the isEdit branch (referencing isEdit, req.Videos, and
aliReq.Input.Media) so malformed requests fail fast instead of silently
discarding additional videos.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c7abb4b8-2d5e-4fee-bbe5-03b8bdc810f3

📥 Commits

Reviewing files that changed from the base of the PR and between a1df2ea and cccf891.

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

Comment on lines 55 to +64
type AliVideoParameters struct {
Resolution string `json:"resolution,omitempty"` // 分辨率: 480P/720P/1080P(图生视频、首尾帧生视频)
Size string `json:"size,omitempty"` // 尺寸: 如 "832*480"(文生视频)
Duration int `json:"duration,omitempty"` // 时长: 3-10秒
PromptExtend bool `json:"prompt_extend,omitempty"` // 是否开启prompt智能改写
Watermark bool `json:"watermark,omitempty"` // 是否添加水印
Audio *bool `json:"audio,omitempty"` // 是否添加音频(wan2.5)
Seed int `json:"seed,omitempty"` // 随机数种子
Resolution string `json:"resolution,omitempty"` // 分辨率: 480P/720P/1080P(图生视频、首尾帧生视频)
Size string `json:"size,omitempty"` // 尺寸: 如 "832*480"(文生视频)
Duration int `json:"duration,omitempty"` // 时长: 3-10秒
Ratio *string `json:"ratio,omitempty"` // 宽高比: Happy Horse t2v/r2v
AudioSetting *string `json:"audio_setting,omitempty"` // 声音控制: Happy Horse video-edit (auto/origin)
PromptExtend bool `json:"prompt_extend,omitempty"` // 是否开启prompt智能改写
Watermark *bool `json:"watermark,omitempty"` // 是否添加水印
Audio *bool `json:"audio,omitempty"` // 是否添加音频(wan2.5)
Seed int `json:"seed,omitempty"` // 随机数种子

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.

⚠️ Potential issue | 🟠 Major

prompt_extend=false will still be dropped upstream.

Watermark was switched to *bool to preserve explicit false, but PromptExtend still has the same bool,omitempty problem. If a client sends prompt_extend: false, the metadata merge can set it locally, but the final marshal will omit the field and Ali never sees the override. Please make PromptExtend a *bool and initialize the default with lo.ToPtr(true).

♻️ Proposed fix
 type AliVideoParameters struct {
 	Resolution   string  `json:"resolution,omitempty"`      // 分辨率: 480P/720P/1080P(图生视频、首尾帧生视频)
 	Size         string  `json:"size,omitempty"`            // 尺寸: 如 "832*480"(文生视频)
 	Duration     int     `json:"duration,omitempty"`        // 时长: 3-10秒
 	Ratio        *string `json:"ratio,omitempty"`           // 宽高比: Happy Horse t2v/r2v
 	AudioSetting *string `json:"audio_setting,omitempty"`   // 声音控制: Happy Horse video-edit (auto/origin)
-	PromptExtend bool    `json:"prompt_extend,omitempty"`   // 是否开启prompt智能改写
+	PromptExtend *bool   `json:"prompt_extend,omitempty"`   // 是否开启prompt智能改写
 	Watermark    *bool   `json:"watermark,omitempty"`       // 是否添加水印
 	Audio        *bool   `json:"audio,omitempty"`           // 是否添加音频(wan2.5)
 	Seed         int     `json:"seed,omitempty"`            // 随机数种子
 }
@@
 		Parameters: &AliVideoParameters{
-			PromptExtend: true, // 默认开启智能改写
+			PromptExtend: lo.ToPtr(true), // 默认开启智能改写
 			Watermark:    lo.ToPtr(false),
 		},

As per coding guidelines relay/**/*.go: “Optional scalar fields MUST use pointer types with omitempty ... field explicitly set to zero/false => non-nil pointer => sent upstream.”

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@relay/channel/task/ali/adaptor.go` around lines 55 - 64, The PromptExtend
field in AliVideoParameters must be changed from bool to *bool so explicit false
is preserved when marshaling; update the struct definition to use PromptExtend
*bool and ensure any code that constructs or merges AliVideoParameters (e.g.,
where instances are created/merged) initializes a default true value using
lo.ToPtr(true) unless explicitly overridden by the client so the field is
non-nil by default and client-set false is sent upstream.

Change len(req.Videos) < 1 to != 1 so requests with more than one
video fail fast instead of silently discarding extras.

The multipart parsing concern (Videos not wired in relay_utils.go) is
not applicable: the ali adaptor uses ValidateMultipartDirect which
calls UnmarshalBodyReusable (JSON deserialization), so Videos is
populated via struct tags. The multipart form path is only used by
other adaptors.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
relay/channel/task/ali/adaptor.go (1)

64-64: Consider using *int for Seed to preserve explicit zero.

Seed int with omitempty will drop seed=0 during marshaling. While edge-case, 0 can be a valid seed value for reproducibility. Using *int would preserve the client's explicit intent.

♻️ Suggested change
-	Seed         int    `json:"seed,omitempty"`            // 随机数种子
+	Seed         *int   `json:"seed,omitempty"`            // 随机数种子

As per coding guidelines relay/**/*.go: "Optional scalar fields MUST use pointer types with omitempty."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@relay/channel/task/ali/adaptor.go` at line 64, The Seed field is defined as a
non-pointer int with `omitempty`, which drops an explicit zero value; change the
struct field type from `int` to `*int` (i.e., Seed *int `json:"seed,omitempty"`)
to preserve explicit zero, then update all call sites that construct or read
Seed (e.g., places that set Seed should take the address of an int variable or
use helper pointer creation, and places that read Seed should nil-check before
dereferencing) so serialization and runtime behavior remain correct.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@relay/channel/task/ali/adaptor.go`:
- Line 64: The Seed field is defined as a non-pointer int with `omitempty`,
which drops an explicit zero value; change the struct field type from `int` to
`*int` (i.e., Seed *int `json:"seed,omitempty"`) to preserve explicit zero, then
update all call sites that construct or read Seed (e.g., places that set Seed
should take the address of an int variable or use helper pointer creation, and
places that read Seed should nil-check before dereferencing) so serialization
and runtime behavior remain correct.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 078ebb51-484e-4438-a6e5-998bd4ac2ebc

📥 Commits

Reviewing files that changed from the base of the PR and between cccf891 and 8283d03.

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

@Calcium-Ion
Calcium-Ion force-pushed the main branch 2 times, most recently from 51fdfc5 to 2b6f1df Compare August 30, 2026 15:03
@wanghualoong wanghualoong closed this by deleting the head repository Sep 16, 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.

1 participant