Non-blocking slot controls + npu/image-gen toggles (cancel mid-load)#801
Merged
Conversation
…id-load) Slot lifecycle controls awaited the backend POST, which blocks for the whole model-load (seconds-to-minutes). That froze the card AND left the Stop button disabled during the `transitional` phase, so a user could not cancel a slow-loading slot until it finished. This extends the fire-and-forget pattern from the save/swap rework (PR #781) to every control surface: - SlotsView / SlotCard: runMutation fires (mutate, not mutateAsync) and toasts immediately; Stop is no longer gated by busy/transitional so a load is cancelable throughout. Start/Restart keep their guards. - SlotListRow: restart fire-and-forget. - NpuFlmStack: run→fire; master is flip-to-cancel (unloads when loaded OR mid-load); modality toggle awaits only the fast config write then fires the cold restart. Drops the long-lived `busy` that froze the trio. - InferencePane SlotControls: shared Stop control always cancelable. - ComfyUI pane: doSwitch/doPin close the dialog + toast on commit rather than after the round-trip (switchover is already a 202-async arbiter flip; status poll drives the transitional UI). Toasts switched to present-progressive ("Stopping X…") since the action is now in-flight, not complete. Regression test: Stop stays enabled on a transitional slot and cancel fires /unload without waiting. Full UI e2e: 237 passed / 6 skipped. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Extends the fire-and-forget pattern from the save/swap rework (#781) to every slot control surface so clicks register instantly and a slow-loading slot can be cancelled mid-load instead of waiting for the model to finish loading.
Why
Lifecycle controls
awaited the backend POST, which blocks for the whole model-load (seconds-to-minutes). That:transitionalphase — so a user who started a slow load (or hit the wrong slot) had no way to cancel until it completed.Changes
runMutationfires (mutate, notmutateAsync) and toasts immediately. Stop is no longer gated bybusy/transitional, so it stays live throughout a load. Start/Restart keep their double-trigger guards.run→fire; the master switch is flip-to-cancel (unloads when loaded or mid-load); the modality toggle awaits only the fast config write, then fires the cold restart. Drops the long-livedbusyflag that froze the whole trio during an FLM reload.SlotControls(shared with the NPU trio) — Stop always cancelable.doSwitch/doPinclose the confirm dialog + toast on commit rather than after the round-trip (the switchover is already a202-async arbiter flip; the status poll drives the transitional UI).Toasts switched to present-progressive ("Stopping X…", "Restarting X…", "Loading NPU stack…") since the action is now in-flight rather than complete.
Test
/unloadwithout waiting.🤖 Generated with Claude Code