Skip to content

Harden Cohere artifact loading and language selection#251

Merged
altic-dev merged 4 commits intomainfrom
B/cohere-production-hardening
Apr 2, 2026
Merged

Harden Cohere artifact loading and language selection#251
altic-dev merged 4 commits intomainfrom
B/cohere-production-hardening

Conversation

@altic-dev
Copy link
Copy Markdown
Owner

@altic-dev altic-dev commented Apr 2, 2026

Description

Hardens Cohere artifact loading and language selection in FluidVoice.

  • Refreshes outdated app-managed Cohere artifacts automatically for older broken installs
  • Replaces brittle Cohere manifest checks with bounded validation
  • Keeps Cohere language selection dynamic without reloading the model
  • Clarifies Cohere language UX in settings
  • Pins FluidAudio to the runtime prompt-override and early model-contract validation changes

Type of Change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📝 Documentation update

Related Issues

  • Closes #(issue number if applicable)

Testing

  • Tested on Intel Mac
  • Tested on Apple Silicon Mac
  • Tested on macOS [version]
  • Ran linter locally: swiftlint --strict --config .swiftlint.yml Sources
  • Ran formatter locally: swiftformat --config .swiftformat Sources
  • Built locally: sh build_incremental.sh

Notes

  • This PR depends on the FluidAudio branch B/cohere-coreml-asr, pinned via Package.resolved.
  • Old app-managed Cohere installs are refreshed automatically once via an artifact bundle stamp.
  • Custom user-provided artifact directories are validated but not automatically re-downloaded.
  • We also observed a transient Cohere load RSS spike on Apple Silicon during model load; that profiling note was kept local and not committed.

Screenshots / Video

No UI screenshots attached for this PR.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +236 to +237
try FileManager.default.removeItem(at: directory)
try FileManager.default.createDirectory(at: directory, withIntermediateDirectories: true)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@altic-dev altic-dev merged commit 6e97120 into main Apr 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant