opencode-pollinations-plugin 5.4.2 → 5.4.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.
|
@@ -73,6 +73,15 @@ export async function generatePollinationsConfig(forceApiKey) {
|
|
|
73
73
|
modelsOutput.push({ id: "free/openai", name: "[Free] OpenAI (Fallback)", object: "model", variants: {} });
|
|
74
74
|
modelsOutput.push({ id: "free/gemini", name: "[Free] Gemini Flash (Fallback)", object: "model", variants: {} });
|
|
75
75
|
}
|
|
76
|
+
// 1.5 FORCE ENSURE CRITICAL MODELS
|
|
77
|
+
// Sometimes the API list changes or is cached weirdly. We force vital models.
|
|
78
|
+
const hasGemini = modelsOutput.find(m => m.id === 'free/gemini');
|
|
79
|
+
if (!hasGemini) {
|
|
80
|
+
log(`[ConfigGen] Force-injecting free/gemini.`);
|
|
81
|
+
modelsOutput.push({ id: "free/gemini", name: "[Free] Gemini Flash (Force)", object: "model", variants: {} });
|
|
82
|
+
// ALIAS for Full ID matching (Fix ProviderModelNotFoundError)
|
|
83
|
+
modelsOutput.push({ id: "pollinations/free/gemini", name: "[Free] Gemini Flash (Alias)", object: "model", variants: {} });
|
|
84
|
+
}
|
|
76
85
|
// 2. ENTERPRISE UNIVERSE
|
|
77
86
|
if (effectiveKey && effectiveKey.length > 5 && effectiveKey !== 'dummy') {
|
|
78
87
|
try {
|
package/dist/server/proxy.js
CHANGED
|
@@ -126,7 +126,9 @@ async function fetchWithRetry(url, options, retries = MAX_RETRIES) {
|
|
|
126
126
|
// Don't retry client errors (except rate limit)
|
|
127
127
|
return response;
|
|
128
128
|
}
|
|
129
|
-
if (retries > 0 && (response.status === 429 || response.status >= 500)) {
|
|
129
|
+
if (retries > 0 && (response.status === 429 || response.status >= 500 || response.status === 520)) {
|
|
130
|
+
// Check for specific "Queue" message in 520/429 body if possible (async read?)
|
|
131
|
+
// For now, just retry blindly on 520/5xx
|
|
130
132
|
log(`[Retry] Upstream Error ${response.status}. Retrying in ${RETRY_DELAY_MS}ms... (${retries} left)`);
|
|
131
133
|
await sleep(RETRY_DELAY_MS);
|
|
132
134
|
return fetchWithRetry(url, options, retries - 1);
|
package/package.json
CHANGED