Skip to content

Fix cover/remaster/extend failing with HTTP 422 (null params.title)#6

Open
leftjeff wants to merge 1 commit into
paperfoot:mainfrom
leftjeff:fix-cover-title-422
Open

Fix cover/remaster/extend failing with HTTP 422 (null params.title)#6
leftjeff wants to merge 1 commit into
paperfoot:mainfrom
leftjeff:fix-cover-title-422

Conversation

@leftjeff

Copy link
Copy Markdown

Problem

Suno's /api/generate/v2-web/ endpoint now requires params.title to be a non-null string. cover, remaster, and extend all build a GenerateRequest without ever setting title, so it serializes as null and every one of those commands fails:

HTTP 422 Unprocessable Entity
{"detail":"[{'type':'string_type','loc':['body','params','title'],'msg':'Input should be a valid string'}]"}

The CLI surfaces this as schema_drift. generate (custom/inspiration) is unaffected because it already sets a title from --title.

Fix

Always send a string title. Added a shared SunoClient::resolve_title helper with this resolution order:

  1. an explicit --title flag (newly added to cover, remaster, and extend)
  2. the source clip's own title — fetched via get_clips, matching what the web app does when you cover/remaster
  3. a generic fallback ("Cover" / "Remaster" / "Extend")

No behavior change for callers who don't care about the title; covers now inherit the original's title by default.

Verification

suno cover <clip_id> --tags "cinematic orchestral piano, theme and variations" --wait --download ./

Previously returned schema_drift; now generates and downloads normally. Builds clean on cargo build --release.

🤖 Generated with Claude Code

Suno's /api/generate/v2-web/ now rejects requests whose `params.title`
is null with:

    HTTP 422 Unprocessable Entity
    {"detail":"[{'type':'string_type','loc':['body','params','title'],
                 'msg':'Input should be a valid string'}]"}

cover(), remaster() and extend all built a GenerateRequest without ever
setting `title`, so it serialized as null and every one of those commands
failed.

Fix: always send a string title. Resolution order (new shared
SunoClient::resolve_title helper):
  1. explicit --title flag (added to cover/remaster/extend)
  2. the source clip's own title (matches the web app's behaviour)
  3. a generic fallback ("Cover"/"Remaster"/"Extend")

Verified end-to-end: `suno cover <clip> --tags "..."` now generates and
downloads instead of returning schema_drift.

Co-Authored-By: Claude <noreply@anthropic.com>
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