Fix model download and management issues#9
Merged
jasielmacedo merged 1 commit intoNov 5, 2025
Merged
Conversation
This commit fixes model download issues and implements context-aware AI interactions: Model Download Improvements: - Add retry logic with exponential backoff (max 3 retries) - Implement proper error handling for network issues (ECONNRESET, ETIMEDOUT, etc.) - Add heartbeat monitoring to detect stalled downloads (2-min timeout) - Add socket keep-alive to prevent connection drops - Track active downloads to prevent duplicate downloads - Provide user-friendly error messages - Add download cancellation support Context Awareness Implementation: - Add PageContext type for current page URL, title, content, and selected text - Add AIContext type combining page context, browsing history, and bookmarks - Update GenerateOptions and ChatOptions to accept optional context - Implement buildContextualSystemPrompt() to inject context into AI prompts - Update generate() and chat() methods to use contextual prompts - Add page:getContext IPC handler to capture current page info - Update IPC handlers to validate and pass context to Ollama service Technical Details: - Add error field to PullProgress for better error reporting - Add retry status to show retry attempts to users - Use HTTP/HTTPS agents with keep-alive for stable connections - Truncate page content to 5000 chars to avoid token limits - Validate all context fields for security This enables the AI to be aware of: - Current browsing page (URL, title, content) - Selected text on the page - Recent browsing history - User bookmarks All changes maintain backward compatibility.
jasielmacedo
deleted the
claude/fix-model-download-management-011CUq8ea9HYHkffLn4VbzwT
branch
November 5, 2025 17:47
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This commit fixes model download issues and implements context-aware AI interactions:
Model Download Improvements:
Context Awareness Implementation:
Technical Details:
This enables the AI to be aware of:
All changes maintain backward compatibility.