opencode-pollinations-plugin 5.4.8-debug.3 → 5.4.8-debug.5
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 +9 -2
- package/package.json +1 -1
package/dist/server/proxy.js
CHANGED
|
@@ -316,7 +316,13 @@ export async function handleChatCompletion(req, res, bodyRaw) {
|
|
|
316
316
|
// =========================================================
|
|
317
317
|
// LOGIC BLOCK: MODEL SPECIFIC ADAPTATIONS
|
|
318
318
|
// =========================================================
|
|
319
|
-
|
|
319
|
+
// Compatibility Fix: Gemini Enterprise rejects tools on some keys/plans (403 Forbidden).
|
|
320
|
+
// We strip tools here to ensure the chat works, restoring previous behavior.
|
|
321
|
+
if (isEnterprise && actualModel.includes('gemini')) {
|
|
322
|
+
delete proxyBody.tools;
|
|
323
|
+
delete proxyBody.tools_config;
|
|
324
|
+
}
|
|
325
|
+
if (proxyBody.tools && Array.isArray(proxyBody.tools) && proxyBody.tools.length > 0) {
|
|
320
326
|
// B0. KIMI / MOONSHOT SURGICAL FIX (Restored for Debug)
|
|
321
327
|
// Tools are ENABLED. We rely on penalties and strict stops to fight loops.
|
|
322
328
|
if (actualModel.includes("kimi") || actualModel.includes("moonshot")) {
|
|
@@ -466,7 +472,8 @@ export async function handleChatCompletion(req, res, bodyRaw) {
|
|
|
466
472
|
// 2. Gemini Tools Fix (Gemini + Tools -> 401 -> Fallback to OpenAI)
|
|
467
473
|
const isEnterpriseFallback = (fetchRes.status === 402 || fetchRes.status === 429 || fetchRes.status === 401 || fetchRes.status === 403) && isEnterprise;
|
|
468
474
|
const isGeminiToolsFallback = fetchRes.status === 401 && actualModel.includes('gemini') && !isEnterprise && proxyBody.tools && proxyBody.tools.length > 0;
|
|
469
|
-
|
|
475
|
+
// STRICT MANUAL MODE: Disable "Magic" Fallbacks
|
|
476
|
+
if ((isEnterpriseFallback || isGeminiToolsFallback) && config.mode !== 'manual') {
|
|
470
477
|
log(`[SafetyNet] Upstream Rejection (${fetchRes.status}). Triggering Transparent Fallback.`);
|
|
471
478
|
if (isEnterpriseFallback) {
|
|
472
479
|
// 1a. Enterprise -> Free Fallback
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-pollinations-plugin",
|
|
3
3
|
"displayName": "Pollinations AI (V5.1)",
|
|
4
|
-
"version": "5.4.8-debug.
|
|
4
|
+
"version": "5.4.8-debug.5",
|
|
5
5
|
"description": "Native Pollinations.ai Provider Plugin for OpenCode",
|
|
6
6
|
"publisher": "pollinations",
|
|
7
7
|
"repository": {
|