Harden Cohere artifact loading and language selection#251
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f4feb32b47
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| try FileManager.default.removeItem(at: directory) | ||
| try FileManager.default.createDirectory(at: directory, withIntermediateDirectories: true) |
There was a problem hiding this comment.
Preserve working artifacts when refresh download fails
In ensureArtifactsPresent, a valid managed Cohere cache with a missing/outdated bundle stamp is deleted immediately before attempting the replacement download. For existing installs that are still functional, a transient Hugging Face/network failure now leaves the artifacts directory empty and makes ASR unusable (including offline), whereas previous behavior kept the working local model. Defer deletion until the new bundle is fully downloaded and validated (or use a temporary directory + atomic swap) so refresh attempts cannot destroy a good cache.
Useful? React with 👍 / 👎.
Description
Hardens Cohere artifact loading and language selection in FluidVoice.
Type of Change
Related Issues
Testing
swiftlint --strict --config .swiftlint.yml Sourcesswiftformat --config .swiftformat Sourcessh build_incremental.shNotes
B/cohere-coreml-asr, pinned viaPackage.resolved.Screenshots / Video
No UI screenshots attached for this PR.