@fro.bot/systematic 2.14.3 → 2.14.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -717,14 +717,14 @@ function readFallbackCache() {
|
|
|
717
717
|
if (openCodeModelsUrl) {
|
|
718
718
|
const urlDerivedPath = path5.join(cacheDir, `models-${fastHash(openCodeModelsUrl)}.json`);
|
|
719
719
|
const urlResult = readModelsFromCache(urlDerivedPath);
|
|
720
|
-
if (urlResult !== null) {
|
|
720
|
+
if (urlResult !== null && urlResult.size > 0) {
|
|
721
721
|
return { status: "cache", models: urlResult };
|
|
722
722
|
}
|
|
723
723
|
return emptyAvailability();
|
|
724
724
|
}
|
|
725
725
|
const defaultPath = path5.join(cacheDir, MODELS_JSON_FILENAME);
|
|
726
726
|
const defaultResult = readModelsFromCache(defaultPath);
|
|
727
|
-
if (defaultResult !== null) {
|
|
727
|
+
if (defaultResult !== null && defaultResult.size > 0) {
|
|
728
728
|
return { status: "cache", models: defaultResult };
|
|
729
729
|
}
|
|
730
730
|
return emptyAvailability();
|
|
@@ -28,10 +28,10 @@ export interface OpencodeClientLike {
|
|
|
28
28
|
* operational consequence is identical and downstream consumers should treat
|
|
29
29
|
* both cases the same way.
|
|
30
30
|
* - `cache`: The API call failed (error envelope, thrown, or timed out) and
|
|
31
|
-
* the local `models.json` cache was readable. `models`
|
|
32
|
-
* OpenCode last wrote to disk.
|
|
33
|
-
*
|
|
34
|
-
*
|
|
31
|
+
* the local `models.json` cache was readable AND non-empty. `models`
|
|
32
|
+
* reflects whatever OpenCode last wrote to disk. A cache that loads
|
|
33
|
+
* successfully but produces a zero-size set collapses to `'unknown'` for
|
|
34
|
+
* the same operational reason an empty API response does.
|
|
35
35
|
* - `unknown`: Either both the API call and the cache fallback failed (cache
|
|
36
36
|
* missing, unreadable, corrupt, or schema-mismatched), OR the API call
|
|
37
37
|
* succeeded with zero usable models. Resolution should degrade gracefully —
|