Skip to content

Non-blocking slot controls + npu/image-gen toggles (cancel mid-load)#801

Merged
thinmintdev merged 1 commit into
mainfrom
feat/non-blocking-slot-controls
Jun 14, 2026
Merged

Non-blocking slot controls + npu/image-gen toggles (cancel mid-load)#801
thinmintdev merged 1 commit into
mainfrom
feat/non-blocking-slot-controls

Conversation

@thinmintdev

Copy link
Copy Markdown
Contributor

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:

  1. Froze the card while the request was in flight, and
  2. Disabled the Stop button during the transitional phase — so a user who started a slow load (or hit the wrong slot) had no way to cancel until it completed.

Changes

  • SlotsView / SlotCardrunMutation fires (mutate, not mutateAsync) and toasts immediately. Stop is no longer gated by busy/transitional, so it stays live throughout a load. Start/Restart keep their double-trigger guards.
  • SlotListRow — restart is fire-and-forget.
  • NpuFlmStackrunfire; 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-lived busy flag that froze the whole trio during an FLM reload.
  • InferencePane SlotControls (shared with the NPU trio) — Stop always cancelable.
  • ComfyUI panedoSwitch/doPin close the confirm dialog + toast on commit rather than after the round-trip (the switchover is already a 202-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

  • New regression: Stop stays enabled on a transitional slot and cancel fires /unload without waiting.
  • Full UI e2e: 237 passed / 6 skipped.

🤖 Generated with Claude Code

…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>
@thinmintdev thinmintdev merged commit 46bdb2d into main Jun 14, 2026
4 checks passed
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.

1 participant