Skip to content

Route non-tagged OpenAI-compatible text prompts to sample_query in OpenRouter endpoints#1217

Draft
ChuxiJ with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-acemusic-duration-issue
Draft

Route non-tagged OpenAI-compatible text prompts to sample_query in OpenRouter endpoints#1217
ChuxiJ with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-acemusic-duration-issue

Conversation

Copilot AI commented May 23, 2026

Copy link
Copy Markdown
Contributor

Standard text-to-music requests sent to /v1/chat/completions without <prompt>/<lyrics> tags were being interpreted as direct prompt input, which broke expected behavior for OpenAI-compatible plain-text flows (notably remote Acemusic usage). This change aligns no-tag handling with documented behavior by routing plain non-lyrics text into sample-query mode.

  • Input parsing fix (both OpenRouter surfaces)

    • Updated no-tag fallback logic in:
      • acestep/openrouter_adapter.py
      • openrouter/openrouter_api_server.py
    • New behavior:
      • lyrics-like text → lyrics
      • non-lyrics text (no XML tags) → sample_query (instead of prompt)
  • Regression coverage

    • Added focused unit tests in acestep/openrouter_adapter_test.py for:
      • plain text (no tags) mapping to sample_query
      • tagged <prompt> still mapping to prompt
      • lyrics-shaped text still mapping to lyrics
  • Behavioral example

    # before (no tags):
    # "Generate an upbeat pop song..." -> prompt
    
    # after (no tags):
    # "Generate an upbeat pop song..." -> sample_query
    # (lyrics-shaped text still -> lyrics)

Copilot AI linked an issue May 23, 2026 that may be closed by this pull request
2 tasks
Copilot AI changed the title [WIP] Fix Acemusic API to accept duration in request Route non-tagged OpenAI-compatible text prompts to sample_query in OpenRouter endpoints May 23, 2026
Copilot AI requested a review from ChuxiJ May 23, 2026 03:33
Copilot finished work on behalf of ChuxiJ May 23, 2026 03:33
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.

Acemusic (remote) needs special <prompt> to accept duration

2 participants