mirror of
https://github.com/docker/docker-agent.git
synced 2026-11-06 15:07:58 +00:00
Adds a build-time snapshot of the models.dev catalog baked into the binary via go:embed, used as last-resort fallback when the cache and live fetch are both unavailable. A generator (pkg/modelsdev/internal/gen) refreshes the snapshot; task update-models and a weekly GitHub Actions workflow keep it current. The fallback snapshot is not memoized on transient fetch failure, so the Store retries the fetch once the network recovers. Context windows for Fable and Opus 4.6-4.8 now come from the embedded snapshot (always available, even offline); the Anthropic client falls back to the flat 200k floor only when no catalogue entry exists. A warning is logged when the embedded snapshot fails to parse so a bad build artifact is discoverable. The snapshot freshness check is opt-in: TestSnapshotDateParses always runs (time-independent) while TestSnapshotDateIsFresh is skipped unless CHECK_MODELS_SNAPSHOT_FRESHNESS is set. A 'task check-models-fresh' target provides the CI backstop. Assisted-By: Claude