[v0.8.3] Offline-registry check fix#54
Merged
LittleCoinCoin merged 3 commits intoMay 31, 2026
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cracking-shells-semantic-release Bot
pushed a commit
that referenced
this pull request
May 31, 2026
## <small>0.8.3 (2026-05-31)</small> * Merge pull request #54 from LittleCoinCoin/hotfix/offline-registry ([c641597](c641597)), closes [#54](#54) * fix(installer): guard remote install against unavailable registry ([49a1c4f](49a1c4f)) * fix(registry): return REGISTRY_UNAVAILABLE sentinel when offline ([180c77d](180c77d)) * test(registry): add offline no-cache and stale-cache regression tests ([e787108](e787108))
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.
Summary
hatch mcp list servers) now keep working when the registry is unreachable and no usable cache exists, instead of crashing with a tracebackRegistryRetriever.get_registry()returns aREGISTRY_UNAVAILABLEsentinel when offline with no cache, rather than raisingBug Fixes
Registry retrieval crashed when offline with no cache (
hatch/registry_retriever.py)Root cause: When the remote registry could not be fetched and no local cache file existed,
get_registry()propagated the fetch exception. Every command that touches the registry on startup — including purely read-only ones — failed with a traceback the moment the machine was offline.Example:
hatch mcp list serverson a laptop with no network and a cold cache → unhandled exception instead of an (empty) listing.Solution:
REGISTRY_UNAVAILABLEsentinel ({"status": "unavailable", "repositories": []})._write_local_cache, the in-memory cache update, and_save_last_fetch_time, so the placeholder is never persisted to disk.errortowarning, with a message that names offline/unpublished-release as the likely cause.Test coverage:
test_offline_no_cache_returns_unavailable_sentinel— offline with no cache returns the sentinel and asserts the cache file is never written.test_offline_stale_cache_returns_stale_data_not_sentinel— offline with a stale cache returns the real (stale) data, not the sentinel.Remote install raised an opaque error against an unavailable registry (
hatch/installers/dependency_installation_orchestrator.py)Root cause: With the registry now able to be
unavailable, the remote-install path would proceed to query a registry with no repositories and surface a confusing failure.Solution:
registry_data.get("status") == "unavailable", raise aDependencyInstallationErrorwith an actionable message — "registry is unavailable. Connect to the internet and retry, or use a local package path."Developer Experience
Offline regression coverage
The two new tests in
tests/test_registry_retriever.pylock in the offline contract: the sentinel is returned (never persisted) when there is no cache, and a stale cache is preferred over the sentinel. Combined with the existing offline checks, 7/7 offline regression tests pass.