fix: replace flaky internet checks with explicit offline mode#1615
Merged
AlexCheema merged 1 commit intomainfrom Feb 24, 2026
Merged
Conversation
7cce807 to
f1fc762
Compare
Remove socket-based internet connectivity probes (1.1.1.1/8.8.8.8 every 10s) that caused false negatives. Replace with an explicit offline mode toggled via --offline CLI flag, EXO_OFFLINE env var, or macOS app settings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
f1fc762 to
e859593
Compare
JakeHillion
reviewed
Feb 24, 2026
JakeHillion
approved these changes
Feb 24, 2026
Contributor
JakeHillion
left a comment
There was a problem hiding this comment.
Looks okay, one comment about missing a bit of cleanup
adurham
pushed a commit
to adurham/exo
that referenced
this pull request
Feb 27, 2026
…plore#1615) The socket-based internet connectivity probes (connecting to 1.1.1.1/8.8.8.8/1.0.0.1 every 10 seconds) are flaky — they produce false negatives on some networks/ISPs, causing downloads to silently fail or get stuck. Instead of dynamically detecting connectivity, this replaces it with an explicit offline mode that the user opts into. - **Removed internet check infrastructure**: Deleted `_test_internet_connection()` (socket probes) and `_check_internet_connection()` (10s polling loop) from `DownloadCoordinator` - **Renamed `internet_connection` → `offline`** on `ShardDownloader` base class and all subclasses (`SingletonShardDownloader`, `CachedShardDownloader`, `ResumableShardDownloader`) - **Removed `on_connection_lost` callbacks** from download calls — no longer needed without dynamic connectivity detection - **Added `EXO_OFFLINE` env var support** in `constants.py` and `Args` default in `main.py` - **Added Offline Mode toggle** to macOS app Settings → General tab, which sets `EXO_OFFLINE=true` in the process environment and restarts The download behavior (`skip_internet` conditionals in `download_utils.py`) is unchanged — we just changed what drives it. Instead of a flaky socket probe setting `internet_connection=True/False`, the user explicitly sets offline mode via: 1. `--offline` CLI flag 2. `EXO_OFFLINE=true` environment variable 3. macOS app Settings → General → Offline Mode toggle This is more reliable and predictable. Users on flaky networks no longer get intermittent download failures. - `uv run exo --offline` starts without internet checks, rejects downloads for unavailable models - `EXO_OFFLINE=true uv run exo` behaves identically - macOS app Settings toggle persists across restarts and passes env var to the exo process - All existing tests pass (222 passed), including 8 offline-mode specific tests - `uv run basedpyright` — 0 errors - `uv run ruff check` — all checks passed - `nix fmt` — 0 files changed 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

Motivation
The socket-based internet connectivity probes (connecting to 1.1.1.1/8.8.8.8/1.0.0.1 every 10 seconds) are flaky — they produce false negatives on some networks/ISPs, causing downloads to silently fail or get stuck. Instead of dynamically detecting connectivity, this replaces it with an explicit offline mode that the user opts into.
Changes
_test_internet_connection()(socket probes) and_check_internet_connection()(10s polling loop) fromDownloadCoordinatorinternet_connection→offlineonShardDownloaderbase class and all subclasses (SingletonShardDownloader,CachedShardDownloader,ResumableShardDownloader)on_connection_lostcallbacks from download calls — no longer needed without dynamic connectivity detectionEXO_OFFLINEenv var support inconstants.pyandArgsdefault inmain.pyEXO_OFFLINE=truein the process environment and restartsWhy It Works
The download behavior (
skip_internetconditionals indownload_utils.py) is unchanged — we just changed what drives it. Instead of a flaky socket probe settinginternet_connection=True/False, the user explicitly sets offline mode via:--offlineCLI flagEXO_OFFLINE=trueenvironment variableThis is more reliable and predictable. Users on flaky networks no longer get intermittent download failures.
Test Plan
Manual Testing
uv run exo --offlinestarts without internet checks, rejects downloads for unavailable modelsEXO_OFFLINE=true uv run exobehaves identicallyAutomated Testing
uv run basedpyright— 0 errorsuv run ruff check— all checks passednix fmt— 0 files changed🤖 Generated with Claude Code