You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Prevent Separate OpenMindAI Processes from Installing Models into the Same Root - #442
PR #438 merged green as 7a9914c6daa474a86f28a2e850b407d3176f8592, protecting two views sharing the same manager instance from concurrent download status and cancellation corruption. A separate desktop process with its own manager could still install models into the same portable root simultaneously, racing the checkpoint, voice/config and manifest writes.
Changes
Add a persistent <portable-root>/.openmindai-model-install.lock, opened read/write and guarded with Rust standard-library exclusive OS File::try_lock (no extra dependencies). The OS releases the lock automatically when its file handle is dropped or its owner exits.
Acquire it before changing status, cancellation token or model files, after the existing in-memory permit. Hold it through the complete model/dependency/manifest installation and final status recording. Reject an overlapping process immediately with a readable error; never steal its progress or cancel it.
Reject symlink/non-regular lock destinations and check root containment; fail closed on unsupported or failed locks. Keep the lock file persistent rather than deleting a possibly locked inode.
Add no-network Rust regression tests for two independently instantiated managers targeting one root, a separate unaffected root, lock reacquisition after release, unsafe lock destination rejection, and preserving status on refused install.
Document advisory-lock semantics, crash recovery, and filesystem limitations.
Review gates
Keep draft until all current-head Windows/macOS/Linux CI, Security/CodeQL, Release Readiness, and real Kokoro cross-platform + production Model Download Manager install-and-speak checks pass. This protects cooperating OpenMindAI processes; it does not claim unrelated software respects advisory locks or that removable/network disks guarantee identical behavior.
CI investigation (2026-10-20): On head 26d062dc733e3cd3312df5cc37a9f4542d26e6c7, all four authentic Kokoro tests, Security/CodeQL, Release Readiness, Frontend validation, Cargo lockfile and Windows Tauri build passed. Windows, macOS and Linux Rust validation failed at the same cargo fmt --check gate, with three formatting diffs in src-tauri/src/model_download.rs: the TryLockError match arms, the rejected-lock assertion, and the error-message assertion. Applied exactly those rustfmt adjustments in commit f200ddef180bd09c79b5612eb11e9c67721f9b76. Fresh head workflows: CI #39461831089, Security #39461831025, Release Readiness #39461831187, and Kokoro Real Voice Inference #39461831771. The PR remains draft and unmerged pending all current-head checks green.
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
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.
Background
PR #438 merged green as
7a9914c6daa474a86f28a2e850b407d3176f8592, protecting two views sharing the same manager instance from concurrent download status and cancellation corruption. A separate desktop process with its own manager could still install models into the same portable root simultaneously, racing the checkpoint, voice/config and manifest writes.Changes
<portable-root>/.openmindai-model-install.lock, opened read/write and guarded with Rust standard-library exclusive OSFile::try_lock(no extra dependencies). The OS releases the lock automatically when its file handle is dropped or its owner exits.Review gates
Keep draft until all current-head Windows/macOS/Linux CI, Security/CodeQL, Release Readiness, and real Kokoro cross-platform + production Model Download Manager install-and-speak checks pass. This protects cooperating OpenMindAI processes; it does not claim unrelated software respects advisory locks or that removable/network disks guarantee identical behavior.