All notable changes to this project will be documented in this file.
- System Prompt Injection: Unified system prompt handling in
restoreChatHistory()to prepend to first user message (consistent withchatStream()). Previously sent as AI message which confused model turn-taking. - Corrupted Model Detection: Added detection of MediaPipe TFLite errors (
ret_check,error building) and auto-deletes corrupted model files for clean re-download. - State Desync Bug: Removed stale
_modelReadylocal state in chat_screen - now uses reactivellmService.isInitializeddirectly. - Double Initialization: Removed redundant
_activateModel()call afterinstallModel()in settings_screen. - Chat History Duplicates: Added
_historyLoadedguard to prevent duplicate message loading.
- Dead Code Cleanup: Removed unused
_toolModel,_activeToolModel,hasToolModel,activeToolModel, andinitializeToolModel()- flutter_gemma only supports one active model at a time.
- Race Condition Prevention: Added mutexes to
initializeModel()anddeleteModel()to prevent concurrent operations. - Install/Delete Guards: Cannot install while deleting or delete while initializing—mutual exclusion enforced.
- Redundant Network Calls: Removed unnecessary
installModel.fromNetwork()call for already-installed models—now just callsgetActiveModel()directly. - Memory Leak:
dispose()now clears_toolModeland_activeToolModelstate. - State Verification:
_installModel()now verifies actual installation success before updating UI state. - Error Feedback: Auto-initialization failures now display error messages to user (previously silent).
- State Sync:
_selectedModelnow properly syncs after model deletion, including fallback to recommended when no models remain. - Init Failure UX: Chat screen now shows model download dialog if initialization fails (previously only logged).
- Parallel Model Checks:
getInstalledModels()now runs in parallel (12x faster on 12 models).
- Expandable Debug Panel: Tap the stats bar during processing to see model info, performance metrics, and recent LLM logs.
- LogBuffer: In-memory log capture for displaying recent events in the debug panel.
- Repo Cleanup: Removed accidentally committed video/GIF artifacts to reduce build size.
- Version Bump: Incremented to 1.7.8+9.
- CRITICAL: User Message Persistence: User messages are now saved to Hive storage (previously only AI responses were persisted).
- Model Deletion State Bug:
deleteModelAndSwitchnow only re-initializes when the active model is deleted, preventing unnecessary model switches. - Premature State Assignment: Removed early
_activeModelassignment ininstallModelthat could leave state stale if initialization failed. - Safer File Deletion: Changed
path.contains()topath.endsWith()indeleteModelfor more precise file matching. - Dead Code Removal: Removed unused try-catch block from
initializeToolModel.
- CRITICAL: Model Deletion Bug:
deleteModel()now uses correctgetApplicationDocumentsDirectory()instead of brokensystemTemp.parent.parentpath. Models are now actually deleted when user taps Delete. - Model Preference Persistence: User's selected model is now saved and restored on app restart instead of falling back to hardcoded priority.
- Single Download Guard: Prevents multiple simultaneous model downloads to avoid memory exhaustion and network contention.
- Dead Code Cleanup: Removed unused
getModelDownloadedStatus()andsetModelDownloadedStatus()from StorageService.
- Token Limit Error: Increased context window from 2048 to 8192 tokens to fix "input is too long" errors in longer conversations.
- Model Detection Bug: Chat screen now detects ANY installed model, not just Gemma 3n E2B.
- ModelType Mismatch: FunctionGemma now uses correct
ModelType.functionGemmainstead ofgemmaIt. - Gemma 3 1B Capabilities: Updated to support function calling per latest flutter_gemma docs.
- Swipe-to-Delete: Swipe left on installed models in Settings to delete them.
- Model Prioritization: Auto-selects best available model (Gemma 3 1B > FunctionGemma > others).
- chatLog Logger: Added dedicated logger for chat screen debugging.
- Default Model: Gemma 3 1B is now the recommended model (was FunctionGemma 270M).
- ModelConfig: Added
modelTypefield to store correct flutter_gemma type per model.
- XML-Structured Prompts: System prompt and tool descriptions now use XML for better LLM parsing.
- Agent Memory System:
save_memoryandsearch_memoriestools for persistent AI observations. - Auto-Routing: Automatic model selection based on input type (images→E2B, tools→FunctionGemma, chat→Gemma 3 1B).
- Dossier Persistence:
update_dossiernow saves to Hive storage. - Psychograph Persistence:
update_psychographnow saves to Hive storage. - Model Deletion: Added
deleteModel()method for removing cached models.
- InputType enum: Added for categorizing request types (text, image, audio, toolRequest).
- FunctionGemma 270M: Added Google's specialized function-calling model for agentic features.
- Multi-Model Architecture: Support for downloading multiple models and switching between them.
- ModelCategory enum: Categorize models by use case (agent/chat/multimodal).
- Package Upgrades: Updated 12 major dependencies for stability (flutter_riverpod 3.0.3, speech_to_text 7.3.0, flutter_local_notifications 19.5.0, etc.).
- MODELS.md: Rewrote documentation with correct capability matrix and cross-referenced sources.
- Capability Bug: Gemma 3 1B no longer incorrectly claims function calling support.
- Notification API: Updated for flutter_local_notifications v19 breaking change.
- Glassmorphism UI: Implemented frosted glass dialogs with backdrop blur effects.
- Shimmer Buttons: Added animated
ShimmerButtonwidget with sweeping gold highlight. - Background Gradients: Subtle radial gradients on Home and Chat screens for depth.
- Dialog Styling: Dialogs now use
AppTheme.frostedDecorationfor a premium glass look. - Chat Bubbles: Updated to use
AppTheme.userBubbleGlassandAppTheme.chatBubbleGlass. - Button Corners: Standardized all buttons to 12px rounded rectangles.
- Color Consistency: Removed all legacy purple/blue hardcoded colors.
- Design System: Integrated "Onyx & Bullion" design language (Imperial Gold, Sterling Silver, Obsidian).
- Notifications: Added persistent "hard" notifications for model download progress using
flutter_local_notifications. - App Icon: Updated App Icon with new "Quadfecta" W logo.
- Typography: Added
google_fonts(Outfit & Inter).
- Theme: Updated
AppThemeto use new color palette and glassmorphism styles. - UI: Refactored
TacticalHudScreento match the new premium aesthetic. - Architecture:
SettingsScreennow initializes notification permissions on launch. - Infrastructure: Updated iOS entitlements to support "Extended Virtual Addressing" for large model memory allocation.
- Crash: Fixed "Cannot allocate memory" error by linking
Runner.entitlementscorrecty inproject.pbxproj.