Home

dev / openkara

publicthedavidweng/OpenKara· sync paused
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

fix(remote): block on condvar for refresh waiters, guard duplicate model downloads, align contract docs

2 months ago

a09c88b
Authored
Davy7/21/2026, 2:14:13 AM
Three fixes for CI review issues:

1. Refresh waiters timeout immediately (Greptile CI): `wait_for_refresh`
   in `remote_source.rs` used a 200-iteration yield loop that exhausted
   before the OAuth round-trip finished, causing waiters to surface a
   spurious 401 and fail active playback. Replaced with a `Condvar` that
   blocks until the refresh leader clears the slot and notifies.

2. Active-variant replacement can start duplicate downloads: Added a
   process-wide `DOWNLOADS_IN_PROGRESS` set in `download_model` that
   prevents concurrent download tasks for the same variant. The second
   call returns the current downloading status instead of spawning a
   duplicate. Added a matching frontend guard in `applyModelVariant`
   that checks `downloadingModel` state before issuing the IPC call.

3. Contract alignment: Added `get_model_status`, `download_model`,
   `delete_model`, and `ModelStatusSnapshot` to the model-bootstrap
   contract. Documented the single-flight download semantics and the
   stale-manifest detection via metadata mismatch.

Parent58939f2

4 files changed
  • docs/references/contracts/model-bootstrap.md+54−1
  • src-tauri/src/audio/remote_source.rs+23−19
  • src-tauri/src/commands/bootstrap.rs+37−1
  • src/components/Settings/SettingsOverlay.state.ts+11−0