Skip to content

Offer engine recovery when a model fails to load#40

Merged
ivan-digital merged 1 commit into
mainfrom
fix/model-error-recovery
Jul 6, 2026
Merged

Offer engine recovery when a model fails to load#40
ivan-digital merged 1 commit into
mainfrom
fix/model-error-recovery

Conversation

@ivan-digital

Copy link
Copy Markdown
Member

Summary

A failed or stalled model load left the toolbar with only a red status chip and no obvious way to switch engines. This makes the error state recoverable: a "Pick another model" button appears next to the error chip and opens the engine picker.

What changed

  • New useEngineSwitch hook: single engine-switch flow (interrupt in-flight load, init the model, settle ready/error status, guard against the user switching again mid-init).
  • TopBar: uses the hook; engine Select is now controlled so the recovery button can open it; error-state tooltip explains the situation.
  • ProjectsMenu: the Hindi demo switches engines through the same flow instead of silently flipping the store without initialization (which showed a stale "ready" chip and deferred the model download to the first synthesis).
  • en/ru strings for the new action.

Test plan

  • 10 new tests: hook status transitions (ready/error/interrupt/no-op/mid-switch race) and TopBar error-state UI (button visibility, opens picker, picking an engine initializes it).
  • Full frontend suite 64/64, tsc clean, vite build ok; cargo test 31 unit + 6 sidecar integration tests pass.

A failed or stalled model load left the toolbar with only a red status
chip; nothing pointed at the engine dropdown as the way out, so users
were stuck on a broken engine. Show an explicit "Pick another model"
action next to the error chip that opens the engine picker, and title
the picker accordingly in that state.

Route every engine switch through one shared flow (useEngineSwitch):
the toolbar selector and the Hindi demo shortcut now both initialize
the sidecar model and settle loading/error status. Previously the demo
flipped the store without init, leaving a stale "ready" chip and
deferring the whole model download to the first synthesis.
@ivan-digital ivan-digital merged commit 5e8d473 into main Jul 6, 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