fix: add short TTL for Hermit self-update binary#272
Merged
jrobotham-square merged 1 commit intomainfrom Apr 22, 2026
Merged
Conversation
The Hermit binary URL (hermit-{os}-{arch}.gz) is mutable — the same URL
serves different versions as Hermit is updated. Without a TTL, Cachew
caches the binary indefinitely (up to the global max-ttl of 24-72h),
causing hermit update --self-update to downgrade to a stale version.
This adds a configurable binary-ttl (default 1h) that applies only to
the Hermit binary downloads, while leaving versioned package downloads
with the default (long) TTL.
Co-authored-by: Amp <[email protected]>
Amp-Thread-ID: https://ampcode.com/threads/T-019db3c3-6d2b-70f9-a2ba-46dab43a882f
189c40b to
5a9bbb3
Compare
alecthomas
approved these changes
Apr 22, 2026
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.
Problem
The Hermit binary URL (
hermit-{os}-{arch}.gz) is mutable — the same URL serves different versions as Hermit is updated. Cachew caches this binary with the global max-ttl (24h disk / 72h S3), which meanshermit update --self-updatefetches a stale version from Cachew's cache, causing workstations to downgrade Hermit even when the Docker image has the correct version baked in.We observed this in staging: the Docker image had Hermit v0.52.1, but
hermit updatedownloaded v0.50.1 through Cachew's cache.Fix
Adds a configurable
binary-ttl(default 1h) to the Hermit strategy that applies a shorter cache TTL specifically to the Hermit self-update binary (hermit-{os}-{arch}.gz). Versioned package downloads continue to use the default (long) TTL since their URLs are content-addressed.Config
No config changes required — the default 1h TTL is used. Can be overridden in
cachew.hcl: