Skip to content

A stopped song stops at once; songs cut off by closing the studio start again - #54

Closed
stalexxx wants to merge 5 commits into
timoncool:mainfrom
stalexxx:fix-cancel-state
Closed

stalexxx wants to merge 5 commits into
timoncool:mainfrom
stalexxx:fix-cancel-state

Conversation

@stalexxx

@stalexxx stalexxx commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Two problems with songs made while the studio is open, seen when an agent (MCP) drives it and when the studio is closed mid-song:

1. A stopped song kept showing as running. The service passed the stop to the engine and kept the job's status as running. The engine ends a job only at its next checkpoint (a queued one when its turn comes; engine.log shows "Cancel requested" while NAR steps carry on), so every window kept the card. Now the job is marked cancelled as soon as the engine accepts the stop, and the windows drop the card. A job the engine already finished is not changed. The engine may still spend its current step; that is the engine's own limit.

2. A song in progress vanished when the studio closed. The queue lives in the engine process and the job list in memory.

  • Every job is now saved to the library database (music_jobs: its request, status and attempt count) as soon as the engine takes it, and its status is written when it ends.
  • At the next start, jobs still queued or running were cut off by the studio closing. Each is marked cancelled (its message names the job that replaced it) and started again from its saved request, oldest first, once the engine answers (up to 3 times per song, so a request that takes the engine down cannot loop). If the engine does not answer within 3 minutes they stay as they are for the next start.
  • No new routes and no new job state; the window picks the new jobs up from the list of running jobs, as it does for an agent's.

Verified (macOS, on top of #51's changes): cargo test -p music-server --lib 285 passed, including a test that a job cut off is found once, oldest first, and not again after it is replaced; tsc and vitest pass. Not verified: the restart itself against a live engine, i.e. closing the studio mid-song and seeing it start again. This branch is based on main and was only type-checked here (RUSTUP_TOOLCHAIN=stable; tests do not build on main on macOS).

🤖 Generated with Claude Code

stalexxx and others added 2 commits October 7, 2026 17:35
…are offered back

- Stopping a song marks its job cancelled when the engine accepts the stop,
  instead of leaving it "running" until the engine reaches a checkpoint, so
  every window drops its card.
- Requests the engine has taken are kept in music-jobs.json until their job
  ends. What is left at the next start is shown as an "Interrupted" card with
  Make again / Remove; nothing starts on its own.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…s again

Replaces music-jobs.json and the /v1/music/interrupted routes. A job is saved
to the library database as soon as the engine takes it and its status is
written when it ends. At the next start, jobs still queued or running were cut
off by the studio closing: each is marked cancelled (its message names the job
that replaced it) and started again, oldest first, at most 3 times.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@stalexxx stalexxx changed the title A stopped song stops at once; songs lost when the studio closed are offered back A stopped song stops at once; songs cut off by closing the studio start again Oct 7, 2026
stalexxx and others added 3 commits October 7, 2026 18:03
A stopped or failed job was kept in the database but only the cut-off ones
were read back, so after a restart the others answered "not found". Their
message is now stored too, and the newest 200 are loaded at start.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
GET /v1/music/jobs/ended lists them (they survive restarts, kept in the
library); DELETE /v1/music/jobs/{id} removes one for good.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…service asks first

The second press of the button ("Reset GPU") stopped every job the service
had, including another window's and an agent's, with no question. Cancel All
now stops only this window's songs, found by the mark each request carries.
The second press is "Stop all on the server" and says how many jobs it
will stop before it does.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@timoncool timoncool mentioned this pull request Oct 8, 2026
@timoncool

Copy link
Copy Markdown
Owner

Done in #51 (merged), shipped in 3.5.0: quitting with songs in progress asks first and stops them; a cancelled song is saved as cancelled at once.

@timoncool timoncool closed this Oct 10, 2026
timoncool added a commit that referenced this pull request Oct 20, 2026
…on the card after an exit that names no device failure (#127, PR #128 by ramishi); the create form keeps its name, style and lyrics across restarts (ACE #54); LoRA training and karaoke CUDA on Linux read what the card runs (#126 by boiler)
timoncool added a commit that referenced this pull request Nov 5, 2026
Fixes since 3.8.3: #194 flash attention off on Blackwell-or-newer, #54 KV cap on
any 8 GB-or-less card, #47 in-memory FLAC, #192 buried-vocal karaoke, #189 SRT
line ends, #184 kept max duration, #198 autogen language, #177 checkpoint names,
#180 update-screen lines, #48 score header, #195 typo; a 1980s Eurodisco LoRA.
Also records 3.8.3 (all-variants engines, #181), which shipped without an entry.
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.

2 participants