Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .claude/skills/acestep/scripts/acestep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,28 @@ CONFIG_FILE="${SCRIPT_DIR}/config.json"
# Output dir at same level as .claude (go up 4 levels from scripts/)
OUTPUT_DIR="$(cd "${SCRIPT_DIR}/../../../.." && pwd)/acestep_output"
DEFAULT_API_URL="http://127.0.0.1:8001"
STAR_MARKER_FILE="${SCRIPT_DIR}/.first_gen_done"

# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
CYAN='\033[0;36m'
NC='\033[0m'
BOLD='\033[1m'

# Show GitHub star prompt on first successful generation
show_star_prompt() {
if [ ! -f "$STAR_MARKER_FILE" ]; then
touch "$STAR_MARKER_FILE"
Comment on lines +30 to +43
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify the code at the specified lines and check set -e status

FILE=".claude/skills/acestep/scripts/acestep.sh"

# Check if file exists
if [ ! -f "$FILE" ]; then
  echo "File not found: $FILE"
  exit 1
fi

# Show lines 1-60 to see context including set -e and the marker file
echo "=== Code from lines 1-60 ==="
head -60 "$FILE" | cat -n

echo ""
echo "=== Checking for set -e ==="
grep -n "set -e" "$FILE" | head -5

echo ""
echo "=== Show star prompt function ==="
sed -n '30,50p' "$FILE" | cat -n

Repository: ace-step/ACE-Step-1.5

Length of output: 3433


Don't persist runtime state inside the checked-out scripts directory.

Line 30 places the marker file at .claude/skills/acestep/scripts/.first_gen_done, and Line 43 writes it unguarded. In read-only or shared installs, the first successful generation fails after saving files because set -e (Line 19) treats the touch failure as fatal. Move the marker to a user-writable state directory and make marker-write failures non-fatal.

Proposed fix
-STAR_MARKER_FILE="${SCRIPT_DIR}/.first_gen_done"
+STAR_STATE_DIR="${XDG_STATE_HOME:-$HOME/.local/state}/acestep"
+STAR_MARKER_FILE="${STAR_STATE_DIR}/first_gen_done"
@@
 show_star_prompt() {
+    mkdir -p "$STAR_STATE_DIR" 2>/dev/null || return 0
     if [ ! -f "$STAR_MARKER_FILE" ]; then
-        touch "$STAR_MARKER_FILE"
+        touch "$STAR_MARKER_FILE" 2>/dev/null || return 0
         echo ""
         echo -e "${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
         echo -e "${BOLD}  ACE-Step is free and open-source.${NC}"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
STAR_MARKER_FILE="${SCRIPT_DIR}/.first_gen_done"
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
CYAN='\033[0;36m'
NC='\033[0m'
BOLD='\033[1m'
# Show GitHub star prompt on first successful generation
show_star_prompt() {
if [ ! -f "$STAR_MARKER_FILE" ]; then
touch "$STAR_MARKER_FILE"
STAR_STATE_DIR="${XDG_STATE_HOME:-$HOME/.local/state}/acestep"
STAR_MARKER_FILE="${STAR_STATE_DIR}/first_gen_done"
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
CYAN='\033[0;36m'
NC='\033[0m'
BOLD='\033[1m'
# Show GitHub star prompt on first successful generation
show_star_prompt() {
mkdir -p "$STAR_STATE_DIR" 2>/dev/null || return 0
if [ ! -f "$STAR_MARKER_FILE" ]; then
touch "$STAR_MARKER_FILE" 2>/dev/null || return 0
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.claude/skills/acestep/scripts/acestep.sh around lines 30 - 43, The script
persists runtime state into the repository via STAR_MARKER_FILE and unguarded
touch inside show_star_prompt, which can fail under read-only/shared installs
and abort due to set -e; change STAR_MARKER_FILE to a user-writable state
location (e.g. use XDG_STATE_HOME or fallback to $HOME/.local/state and a subdir
for this script) and update show_star_prompt to create the directory if needed
and perform the touch in a non-fatal way (ensure failures are ignored so the
script continues under set -e). Reference STAR_MARKER_FILE and the
show_star_prompt function when making the change.

echo ""
echo -e "${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo -e "${BOLD} ACE-Step is free and open-source.${NC}"
echo -e " If you enjoyed this, a ${YELLOW}★ Star${NC} on GitHub means a lot to us!"
echo -e " ${CYAN}→ https://github.com/ace-step/ACE-Step${NC}"
echo -e "${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
fi
}

# Check dependencies
check_deps() {
Expand Down Expand Up @@ -697,6 +712,7 @@ send_completion_request() {

echo ""
echo -e "${GREEN}Done! Files saved to: $OUTPUT_DIR${NC}"
show_star_prompt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

--no-wait native jobs never hit this prompt.

Line 715 and Line 760 only cover synchronous completion paths. generate --no-wait bypasses wait_for_job(), and the cmd_status() success path around Line 431-Line 433 saves/downloads the finished result without calling show_star_prompt(), so async native users never see the one-time prompt.

Minimal fix
@@
             # Save and download
             save_result "$job_id" "$response"
             download_audios "$api_url" "$job_id" "$result_file"
+            show_star_prompt
             rm -f "$result_file"

Also applies to: 760-760

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

In @.claude/skills/acestep/scripts/acestep.sh at line 715, The one-time prompt
function show_star_prompt is only called in synchronous completion flows (via
wait_for_job()), so async native jobs started with "generate --no-wait" never
see it; update the async success path in cmd_status() (the branch that currently
saves/downloads the finished result around the success handling at lines
~431-433) to invoke show_star_prompt after the result is persisted, or refactor
both sync and async completion paths to call a shared success handler that calls
show_star_prompt; ensure the change covers both invocation sites noted (around
Line 715 and Line 760) so the prompt is shown for both sync and --no-wait
completions.

}

# Wait for job and download results
Expand Down Expand Up @@ -741,6 +757,7 @@ wait_for_job() {

echo ""
echo -e "${GREEN}Done! Files saved to: $OUTPUT_DIR${NC}"
show_star_prompt
return 0
;;
2)
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ acestep/third_parts/vllm/
test_lora_scale_fix.py
lokr_output/
.claude/skills/acestep/scripts/config.json
.claude/skills/acestep/scripts/.first_gen_done
acestep_output/
# macOS
.DS_Store