opencode-pollinations-plugin 5.2.0 → 5.2.1
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/server/proxy.js +6 -6
- package/package.json +1 -1
package/dist/server/proxy.js
CHANGED
|
@@ -228,12 +228,12 @@ export async function handleChatCompletion(req, res, bodyRaw) {
|
|
|
228
228
|
isFallbackActive = true;
|
|
229
229
|
fallbackReason = "Quota Unreachable (Safety)";
|
|
230
230
|
}
|
|
231
|
-
else if (quota.tierRemaining <=
|
|
232
|
-
log(`[SafetyNet] AlwaysFree Mode:
|
|
231
|
+
else if (quota.tierRemaining <= (config.thresholds.tier / 100)) {
|
|
232
|
+
log(`[SafetyNet] AlwaysFree Mode: Tier threshold (${config.thresholds.tier}%) reached. Switching to Free Fallback.`);
|
|
233
233
|
actualModel = config.fallbacks.free.main.replace('free/', '');
|
|
234
234
|
isEnterprise = false;
|
|
235
235
|
isFallbackActive = true;
|
|
236
|
-
fallbackReason =
|
|
236
|
+
fallbackReason = `Daily Tier < ${config.thresholds.tier}% (Wallet Protected)`;
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
}
|
|
@@ -246,12 +246,12 @@ export async function handleChatCompletion(req, res, bodyRaw) {
|
|
|
246
246
|
isFallbackActive = true;
|
|
247
247
|
fallbackReason = "Quota Unreachable (Safety)";
|
|
248
248
|
}
|
|
249
|
-
else if (quota.walletBalance <
|
|
250
|
-
log(`[SafetyNet] Pro Mode: Wallet Critical (
|
|
249
|
+
else if (quota.walletBalance < config.thresholds.wallet && quota.tierRemaining <= 0.1) { // Tier is loose here, wallet is primary
|
|
250
|
+
log(`[SafetyNet] Pro Mode: Wallet Critical (<$${config.thresholds.wallet}). Switching to Free Fallback.`);
|
|
251
251
|
actualModel = config.fallbacks.free.main.replace('free/', '');
|
|
252
252
|
isEnterprise = false;
|
|
253
253
|
isFallbackActive = true;
|
|
254
|
-
fallbackReason =
|
|
254
|
+
fallbackReason = `Wallet < $${config.thresholds.wallet}`;
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
}
|
package/package.json
CHANGED