You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4d805ae
Browse filesBrowse the repository at this point in the historyBrowse files
fix: harden the catalog guard against hangs and hollow payloads
Addresses review findings on the guard added in the previous commit.
Bound the fetch with `AbortSignal.timeout(60s)`. A blackholed connection is the
one failure `fetch` does not surface on its own — no error, no bytes, just a
hang until the job's own timeout kills it with no useful message. The previous
version claimed to fail loudly but would have hung in that case.
Validate provider records, not just top-level keys. A payload can carry 50+
keys whose values are junk: that passed the old key-count check and would have
shipped a catalog with nothing selectable. Each required provider must now
carry a non-empty `models` object. Verified against a crafted payload of 80
junk keys and one where every provider is present but hollow.
Also drops the duplicated `${modelsUrl}/api.json` construction and the repeated
`process.env.MODELS_DEV_API_JSON` reads, and avoids an unsafe type assertion by
reading the parsed catalog through a `Map<string, unknown>`.
Not changed: the eight matrix builds still fetch independently, so a models.dev
update mid-release could in principle give different binaries different
catalogs. Fixing that needs a fetch-once job passing the catalog as an artifact,
which is a larger change than this PR; upstream has the same property.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VqnuBDGkh1ZT65Ti7e6DHZ
0 commit comments