opencode-pollinations-plugin 5.4.8-debug.4 → 5.4.8-debug.6

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.
@@ -316,7 +316,7 @@ export async function handleChatCompletion(req, res, bodyRaw) {
316
316
  // =========================================================
317
317
  // LOGIC BLOCK: MODEL SPECIFIC ADAPTATIONS
318
318
  // =========================================================
319
- if (proxyBody.tools && Array.isArray(proxyBody.tools)) {
319
+ if (proxyBody.tools && Array.isArray(proxyBody.tools) && proxyBody.tools.length > 0) {
320
320
  // B0. KIMI / MOONSHOT SURGICAL FIX (Restored for Debug)
321
321
  // Tools are ENABLED. We rely on penalties and strict stops to fight loops.
322
322
  if (actualModel.includes("kimi") || actualModel.includes("moonshot")) {
@@ -369,9 +369,14 @@ export async function handleChatCompletion(req, res, bodyRaw) {
369
369
  });
370
370
  // 2. Sanitize & RESTORE GROUNDING CONFIG (Essential for Vertex Auth)
371
371
  if (proxyBody.tools.length > 0) {
372
- // v5.4.1: MUST send tools_config to avoid 401 Unauthorized on Vertex
373
- proxyBody.tools_config = { google_search_retrieval: { disable: true } };
374
- proxyBody.tools = sanitizeToolsForVertex(proxyBody.tools);
372
+ if (hasFunctions) {
373
+ proxyBody.tools = sanitizeToolsForVertex(proxyBody.tools);
374
+ // ONLY for Free/Vertex: Add tools_config to disable search grounding (required for free tier).
375
+ // For Enterprise, adding this causes 403 Forbidden on some keys.
376
+ if (!isEnterprise) {
377
+ proxyBody.tools_config = { google_search_retrieval: { disable: true } };
378
+ }
379
+ }
375
380
  }
376
381
  else {
377
382
  // 3. If no tools left (or only search was present), DELETE 'tools' entirely
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",
4
+ "version": "5.4.8-debug.6",
5
5
  "description": "Native Pollinations.ai Provider Plugin for OpenCode",
6
6
  "publisher": "pollinations",
7
7
  "repository": {