Conversation
- Add `text2sample` to TASK_INSTRUCTIONS, GENERATION_MODES, and MODE_TO_TASK_TYPE in constants.py - Auto-enable sample_mode in llm_generation_inputs.py when task_type=text2sample; promote prompt to sample_query when sample_query is empty - Add text2sample (item 7) to CLI interactive task selection with appropriate prompts - Update CLI validation to allow sample_mode/sample_query for text2sample - Add 'Sample' mode to Gradio UI (shows simple_mode_group + disabled generate_btn; button enables after Create Sample); task_type stays text2sample after create_sample - Pass current generation_mode to handle_create_sample so Sample mode preserves task_type - Handle text2sample in openrouter API server (treats message text as sample_query) - Add text2sample to Streamlit config GENERATION_MODES - Add mode_info_sample i18n strings in en/ja/zh/he - Add 7 unit tests for text2sample behavior in text2sample_test.py Co-authored-by: ChuxiJ <30956809+ChuxiJ@users.noreply.github.com>
ChuxiJ
left a comment
There was a problem hiding this comment.
Code Review
Overall: Well-structured PR that follows existing conventions. A few items to address before merge.
Key Issues
-
Medium - Restore trailing newlines in i18n JSON files: The diff removes trailing newlines from
en.json,he.json,ja.json, andzh.json. This is unnecessary and may conflict with editor configs or linters that expect POSIX-compliant final newlines. -
Medium - Missing edge case tests: Add tests for:
text2samplewith empty prompt AND emptysample_querytext2samplewith bothpromptandsample_queryprovided
-
Low - Inconsistent
getattrusage:getattr(req, "task_type", "text2music")is used on line ~78, but the next line usesreq.task_typedirectly. SinceGenerationRequestalways hastask_type, just usereq.task_typefor consistency. -
Low -
_did_promote_prompt_as_queryflag is fragile: Consider replacing with an inline condition check at the consumption site to reduce coupling between distant code sections. -
Low - Brittle test assertion:
test_text2sample_promotes_prompt_as_query_when_sample_query_emptycheckscall_argswithout assertingcall_args is not Nonefirst, so it could silently pass withNone == None. -
Low - Duplicate emoji in Streamlit config:
text2samplereuses the same 🎼 emoji as "Complete Section". Consider using a distinct emoji.
Minor Notes
- The
print()for disablinguse_cot_lyricsshould use the logging infrastructure instead - OpenRouter callers may get different behavior than direct API callers for empty prompt+sample_query (no
"NO USER INPUT"fallback)
No blocking issues. The main items are trailing newlines and edge case test coverage.
Adds
text2sampleas a first-class task type throughout the stack, enabling short production-sample generation from plain-text descriptions (the workflow used by models like RoyalCities/Foundation-1). Differs fromtext2musicin its DiT instruction and the fact that it always triggers LLM-driven metadata generation without requiringsample_mode=Truefrom the caller.API / generation pipeline
constants.py: registers"text2sample"inTASK_INSTRUCTIONS("Generate a music sample based on the given conditions:"),GENERATION_MODES_TURBO/BASE, andMODE_TO_TASK_TYPE("Sample"→"text2sample").llm_generation_inputs.py: whentask_type="text2sample", implicitly setssample_mode=Trueand promotesreq.prompt→sample_querywhensample_queryis empty, so callers can use the standard prompt field without extra flags.CLI
text2sampleis now option 7 in the interactive task menu.sample_mode=True; validation updated to allow--sample_mode/--sample_queryfor this task type.python cli.py generate --task_type text2sample --sample_query "lofi piano chord loop, Bb minor, 85 BPM"Gradio UI
task_type="text2sample".task_type="text2sample"); in Simple mode it continues to switch to Custom as before.i18ndescription strings added for all four supported languages.OpenRouter server
sample_querywhentask_type="text2sample", consistent withsample_modebehavior.Tests
acestep/api/text2sample_test.py: 7 unit tests covering auto-enable ofsample_mode, prompt promotion, non-regression fortext2music, and constants correctness.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
huggingface.co/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.