Skip to content

Fix local ASR model storage management#565

Merged
H-Chris233 merged 2 commits into
Open-Less:betafrom
H-Chris233:fix/issue-559-local-model-management
May 31, 2026
Merged

Fix local ASR model storage management#565
H-Chris233 merged 2 commits into
Open-Less:betafrom
H-Chris233:fix/issue-559-local-model-management

Conversation

@H-Chris233
Copy link
Copy Markdown
Collaborator

@H-Chris233 H-Chris233 commented May 31, 2026

User description

Summary

  • add a unified local ASR model storage setting with custom parent directory support
  • show model storage paths and open model/root directories from the UI
  • support deleting Qwen3-ASR, Foundry Local Whisper, and sherpa-onnx local model caches with confirmation
  • migrate existing model files when switching storage roots without overwriting target files
  • guard Foundry Local storage changes after its SDK singleton has initialized to avoid silently using the old cache directory

Fixes #559

Verification

  • cargo test --manifest-path "openless-all/app/src-tauri/Cargo.toml" custom_models_root_uses_openless_models_suffix -- --test-threads=1
  • cargo test --manifest-path "openless-all/app/src-tauri/Cargo.toml" migrate_models_root_merges_without_overwriting_target_files -- --test-threads=1
  • cargo check --manifest-path "openless-all/app/src-tauri/Cargo.toml"
  • npm --prefix "openless-all/app" run build
  • git diff --check

PR Type

Bug fix, Enhancement


Description

  • Add configurable model storage root

    • Validate writable directories before switching
    • Migrate existing caches without overwriting
  • Show model paths in the UI

    • Display storage root and file locations
    • Add folder reveal actions
  • Add local model delete commands

    • Support Qwen3, Foundry, and sherpa
    • Confirm deletions before removing files
  • Guard Foundry storage changes

    • Block root changes after init

Diagram Walkthrough

flowchart LR
  A["Local ASR settings"] -- "choose storage root" --> B["Validate writable model directory"]
  B -- "migrate existing files" --> C["Update persisted preferences"]
  C -- "refresh UI paths" --> D["Show model folders in UI"]
  D -- "reveal/delete actions" --> E["Manage Qwen, Foundry, sherpa models"]
  F["Foundry runtime initialized"] -- "block storage changes" --> B
Loading

File Walkthrough

Relevant files
Bug fix
1 files
foundry_runtime.rs
Prevent runtime storage changes after init                             
+54/-1   
Enhancement
6 files
sherpa_download.rs
Track active sherpa download tasks                                             
+4/-0     
commands.rs
Add storage, reveal, and delete commands                                 
+216/-3 
lib.rs
Register new local ASR commands                                                   
+8/-0     
persistence.rs
Add configurable model root migration                                       
+193/-4 
localAsr.ts
Expose storage and model path APIs                                             
+80/-0   
LocalAsr.tsx
Add storage UI and file actions                                                   
+380/-6 
Configuration changes
1 files
types.rs
Persist custom local model base dir                                           
+10/-0   
Documentation
5 files
en.ts
Add local ASR storage strings                                                       
+14/-0   
ja.ts
Add local ASR storage strings                                                       
+14/-0   
ko.ts
Add local ASR storage strings                                                       
+14/-0   
zh-CN.ts
Add local ASR storage strings                                                       
+14/-0   
zh-TW.ts
Add local ASR storage strings                                                       
+14/-0   

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 31, 2026

PR Reviewer Guide 🔍

(Review updated until commit 550f410)

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis ✅

559 - PR Code Verified

Compliant requirements:

  • Delete action for downloaded local ASR models
  • Model file paths shown in the UI
  • Configurable local model storage root with migration support

Requires further human verification:

  • UI interaction flow for choosing, resetting, deleting, and revealing model folders
  • File-manager opening behavior on each supported desktop platform
⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Weak Storage Guard

The new storage lock only checks whether the runtime manager exists. If Foundry Local has already been initialized earlier in the session and then released, the manager can be None while the SDK singleton still keeps the old cache directory. In that case the app will still allow changing the storage root, which can leave Foundry reading or writing from the previous location instead of the newly selected one.

pub fn storage_configuration_locked(&self) -> bool {
    self.state.lock().manager.is_some()
}

@github-actions
Copy link
Copy Markdown

Persistent review updated to latest commit 550f410

@H-Chris233 H-Chris233 merged commit bbc78d1 into Open-Less:beta May 31, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[area] 下载到本地模型,删除按钮没有,而且也不知道下载在哪了

1 participant