Skip to content

fix: add short TTL for Hermit self-update binary#272

Merged
jrobotham-square merged 1 commit intomainfrom
jrobotham/hermit-binary-ttl
Apr 22, 2026
Merged

fix: add short TTL for Hermit self-update binary#272
jrobotham-square merged 1 commit intomainfrom
jrobotham/hermit-binary-ttl

Conversation

@jrobotham-square
Copy link
Copy Markdown
Contributor

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 means hermit update --self-update fetches 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 update downloaded 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:

strategy hermit {
  binary-ttl = "30m"
}

@jrobotham-square jrobotham-square requested a review from a team as a code owner April 22, 2026 06:46
@jrobotham-square jrobotham-square requested review from joshfriend and removed request for a team April 22, 2026 06:46
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
@jrobotham-square jrobotham-square force-pushed the jrobotham/hermit-binary-ttl branch from 189c40b to 5a9bbb3 Compare April 22, 2026 06:51
@jrobotham-square jrobotham-square enabled auto-merge (squash) April 22, 2026 09:52
@jrobotham-square jrobotham-square merged commit e38ebfd into main Apr 22, 2026
10 of 11 checks passed
@jrobotham-square jrobotham-square deleted the jrobotham/hermit-binary-ttl branch April 22, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants