Queue scheduling and controls (#52) #106
No reviewers
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
needs-info
needs-triage
question
ready-for-agent
ready-for-human
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crowmaki/ai-studio!106
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-52-queue-scheduling"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #52. Part of #24.
What changed
Scheduling (
studio-core/src/schedule.rs, pure, unit-tested)Controls (
studio-core/src/queue.rs, schema V24)POST /api/jobs/{id}/cancel. If that answers anything but 200, the app falls back to/api/interruptwithprompt_idplus a/api/queuedelete, and sends both. The worker also looks for cancellation while the job runs. If it finds one, it stops the prompt itself and drops the output, which covers a cancel that happens before ComfyUI has the prompt.rendition. No final can be queued yet (#54/#57).Status
UI
Notes for the reviewer
Tests
schedule.rsunit tests: class order, FIFO, affinity, the skip limit and window, Run next, holds, pause.tests/queue_scheduling.rsruns against the fake ComfyUI. It covers class order, affinity with the 3-pass limit, drag and Run next, pause, hold and release, the Hold finals switch staying on after reopen, cancelling queued and running Takes (with and without the jobs API), cancel before ComfyUI reports, failed jobs pinned until dismissed, and one pending final per Take.JobScript::Hang,/interrupt,/queueand a switchable/jobs/{id}/cancel.src-tauri/tests/takes.rscovers the RPC wiring. Bun tests cover the badge and grouping helpers.cargo test --workspace --all-features,bun test src scriptsandbun run checkall pass.Screenshots
Queue docked at the bottom: paused, a failed job pinned, Run next and Drafts groups:

Queue docked on the right, with a held job and one ticked for Run next. The Shot row badge shows "2 queued":

Take tiles with Failed / Queued / Held badges:

Opening a failed Take shows why it failed and dismisses its pinned job:
