Repository navigation
fix: crash guards for LLM endpoint URL + ASR model loading - #623
Merged
H-Chris233 merged 1 commit intoJun 9, 2026
Conversation
Three defensive layers to prevent user-facing crashes: 1. coordinator/llm_pipeline.rs: Auto-prepend http:// when endpoint URL is missing scheme (user types 192.168.1.100:8080/v1 without http://). Add catch_unwind guards around all 4 build_active_llm_provider call sites to turn panics (e.g. poisoned credentials mutex) into logged errors instead of process kills. 2. polish.rs: Replace try_clone().expect() with safe fallback — if the request body isn't clonable, send once without retry instead of panicking the process. 3. test_run.rs: Validate model files (config.json, vocab.json, merges.txt exist and are non-empty; at least one .safetensors >= 1KB) before calling into the C FFI qwen_load / qwen_transcribe_audio, preventing segfaults from corrupted/incomplete model downloads.
Contributor
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
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.
User description
修复两个用户侧崩溃场景,详见 H-Chris233#2
PR Type
Bug fix
Description
Validate ASR model files before FFI call to prevent segfaults
Guard LLM provider construction with catch_unwind to avoid panics
Auto-prepend http:// to endpoint URLs missing scheme
Replace expect() with safe retry fallback in polish module
Diagram Walkthrough
File Walkthrough
test_run.rs
Add ASR model file validation before C FFI callopenless-all/app/src-tauri/src/asr/local/test_run.rs
vocab.json, merges.txt) existence and non-empty.
llm_pipeline.rs
Wrap LLM provider creation with panic guard and fix URL schemeopenless-all/app/src-tauri/src/coordinator/llm_pipeline.rs
process.
typed IP:port).
polish.rs
Replace expect() with safe retry fallback for non-clonable bodyopenless-all/app/src-tauri/src/polish.rs
clonable, send once without retry.