mirror of
https://github.com/Finesssee/ProxyPilot.git
synced 2026-11-19 02:17:46 +00:00
Tool outputs like "[1,2,3]\n\n[Process exited with code 0]" were being partially parsed by gjson.Parse() which would extract just "[1,2,3]" and lose the trailing text. This caused invalid JSON in the Gemini request. Fix: Use gjson.Valid() to verify the ENTIRE string is valid JSON before treating it as raw JSON. If validation fails, treat as a string with proper escaping via sjson.Set(). Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>