Skip to content

v2.0.1 β€” Code quality pass

Choose a tag to compare

@wil-pe wil-pe released this 16 Apr 16:38
· 22 commits to main since this release

πŸ› οΈ Code quality pass: critical fixes & stability hardening

This release focuses on stability and robustness β€” no new user-facing features, but the app is now significantly more reliable.

πŸ”΄ Critical fixes

  • Debate engine completely rewritten as a stateful class
    • Eliminates Swift 6 Sendable warnings (captured var in concurrent closures)
    • Validates each cat still exists before its turn β€” survives mid-debate cat removal
    • Generation counter invalidates stale callbacks if the debate is stopped
    • DispatchQueue.main.asyncAfter instead of Timer.scheduledTimer from URLSession queue (was undefined behavior)
    • Public stop() called from removeCat and applicationWillTerminate
  • Debate button now appears reliably β€” a didSet observer on debateEnabled rebuilds the bubble
  • OllamaChat session race fixed β€” delegate no longer nullifies a newer in-flight session
  • fatalError at startup β†’ NSAlert with a clear message + terminate (assets missing / no screen)

🟠 Memory & performance

  • tintCache bounded with NSCache (600 items) β€” was a dictionary growing unbounded
  • getPreview tinted images now cached
  • Orphan mem_<UUID> entries in UserDefaults purged at startup
  • URLSession properly finishTasksAndInvalidate()d (delegate was leaking)
  • frontmostWindowFrame cached 200 ms β€” reduces CGWindowListCopyWindowInfo calls

🟑 Polish

  • addCat captures the new instance directly and rolls back the config on failure (no more last!)
  • appendResponse no longer steals focus to the input field if the user wasn't focused there
  • BehaviorTuning enum centralizes all AI tuning magic numbers
  • Dictionary.localized() helper dedupes the [lang] ?? ["fr"] ?? "" pattern

Build

  • Zero warnings, zero errors

Install

unzip CATAI.zip
xattr -cr CATAI.app   # remove macOS quarantine (app is unsigned)
open CATAI.app

Full changelog: v2.0...v2.0.1