Fix: Model downloads failing on VPN connections (SSL/TLS decrypt error). QoL: Retry button#1574
Fix: Model downloads failing on VPN connections (SSL/TLS decrypt error). QoL: Retry button#1574NeuralFault wants to merge 8 commits intoLykosAI:mainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves the reliability and user experience of model downloads by introducing both automatic and manual retry mechanisms. It addresses issues where downloads might fail due to transient network problems, particularly common with VPN connections, by implementing intelligent error detection, exponential backoff, and a user-initiated retry option. The changes ensure that users can more easily recover from failed downloads without having to restart the entire process. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a robust retry mechanism for model downloads, addressing failures on unstable connections like VPNs, and includes a manual 'Retry' button and exponential backoff for automatic retries. However, the current implementation has a significant race condition where multiple download tasks can be started for the same file, potentially leading to data corruption. Additionally, the automatic retry logic does not respect user cancellation during the backoff period, and there is a resource leak in the service layer when re-registering downloads. Furthermore, some file I/O operations in async methods are synchronous, which can block the calling thread, and should be made asynchronous to maintain application responsiveness.
|
Give me a bit to modify and thoroughly verify |
…tream leak, and race guards in Resume/Start
|
@gemini-code-assist review |
There was a problem hiding this comment.
Code Review
This pull request effectively addresses download failures on unstable connections by introducing both automatic retries with exponential backoff and a manual retry option for the user. The changes are well-structured, extending the view models and services to support the new functionality. The detection of transient network errors, including SSL/TLS-related AuthenticationException, is a thoughtful addition that will improve robustness, particularly for users on VPNs. I have a couple of minor suggestions to improve maintainability by reducing code duplication and eliminating a magic number.
|
Ready for merge |
This pull request introduces user-facing support for retrying failed model downloads, including UI updates, business logic, and robust handling of transient network errors. The main changes add a "Retry" button to the download manager, implement the underlying retry logic with exponential backoff, and ensure proper state management for retries.
User-facing and ViewModel changes:
Added a

Retrybutton to the download manager UI, visible only when a download has failed and retry is supported (ProgressManagerPage.axaml).Extended
PausableProgressItemViewModelBaseto support retry functionality: addedSupportsRetry,CanRetry, andRetryCommandproperties/methods, allowing subclasses to define retry logic and expose it to the UI. [1] [2] [3]Enabled retry support in
DownloadProgressItemViewModeland implemented theRetrymethod to reset the attempt counter and re-register the download for retry. [1] [2]Core download logic improvements:
AuthenticationException) as retryable, and implemented exponential backoff with jitter for automatic retries—persisting state before delay to ensure resumability. [1] [2] [3] [4]ResetAttemptsmethod toTrackedDownloadto allow manual retry to reset the attempt counter and state cleanly.Service layer changes:
TryRestartDownloadtoITrackedDownloadServiceand its implementation, allowing failed downloads to be re-added to the tracking dictionary and resumed as new retry attempts. [1] [2]When a user is on a VPN connection, the tunnel connection can be rerouted on the provider's end from time to time, which breaks the TCP download stream for a short period. (Known case with NordVPN and Proton VPN)
When this happens the current logic immediately tries to continue the download before the connection can correct itself and commonly fails through each of the 3 retries in the current logic. Leading to failed download state and user has to go back to Model Browser and manually retry the download all over again.
This keeps the 3 retries but allows time for the connection to fully reset so the download can properly resume. In the extreme case that it still fails the 3 retries, have added a retry button for QoL instead of having to manually search the model again to restart the download.