- 23 Aug, 2025 9 commits
-
-
nextime authored
- Change '\\n' to '\n' in allTexts.join() call - This was causing 'missing ) after argument list' error in page.evaluate - JavaScript string literals need single backslash, not double backslash - Resolves the remaining JavaScript syntax error in JSON response detection
-
nextime authored
- Add proper null checking for chained .match() calls - Prevent 'missing ) after argument list' error when second match returns null - Improve error handling in malformed JSON response extraction - This resolves the JavaScript syntax error in page.evaluate function
-
nextime authored
- Replace inline regex literals with RegExp constructors for dynamic requestId - Fix 'missing ) after argument list' error in JSON pattern matching - Update all regex patterns to use proper RegExp constructor syntax - Ensure proper string concatenation with requestId variable - Fix jsonMatch pattern to use separate RegExp objects This resolves the JavaScript syntax error that was causing page.evaluate to fail during JSON response detection.
-
nextime authored
- Update wait_for_selector timeout from 60 seconds to 48 seconds - Align page timeout with reply timeout (45s) plus 3 second buffer - Ensure page operations don't timeout before response detection completes - Improve coordination between page interaction and response waiting phases This prevents page timeout issues while maintaining reasonable wait times for container selector detection during chatbot interactions.
-
nextime authored
- Change prompt instruction to request base64 encoded responses instead of escaped text - Add base64 import and decoding logic in forward_to_chatbot function - Update JSON validation to verify base64 format using regex and atob() validation - Add comprehensive error handling for base64 decoding with fallback to raw response - Enhanced logging to track base64 decoding success/failure - Prevent issues with special characters, HTML entities, and complex formatting This approach eliminates problems with HTML encoding, escape sequences, and special characters by having the chatbot encode the entire response in base64 format, which we then decode on the proxy side.
-
nextime authored
- Add comprehensive logging with emojis for better debugging visibility - Implement strict validation requiring exact ID match and non-empty response - Enhanced observer logic to only resolve on complete, validated JSON - Add priority-based detection: HTML code blocks first, then text content - Prevent premature response serving until complete JSON with matching ID is found - Add detailed console logging for tracking detection progress - Ensure system waits for complete ID match before serving any API response This ensures the API absolutely waits for the complete JSON response with the matching request ID before serving any reply to clients.
-
nextime authored
- Increase main timeout to 45 seconds as requested for complete response detection - Add strict JSON validation requiring both 'response' and 'id' keys - Implement isCompleteValidJson() function to ensure JSON completeness - Only return responses when JSON is complete and valid - Add enhanced logging for debugging partial matches - Prevent premature response extraction from incomplete JSON - Add safety timeout at 60 seconds to prevent hanging - Improve observer logic to only resolve on complete, valid JSON This ensures the API only serves responses when we have complete, valid JSON with both required keys, preventing partial or corrupted responses.
-
nextime authored
- Replace spy word detection with robust JSON-based response extraction - Add UUID-based unique request identification for better reliability - Implement comprehensive JSON parsing with error recovery mechanisms - Add support for partial JSON response extraction - Enhance error handling for malformed JSON responses - Improve detection of responses containing code blocks and special formatting - Better handling of dynamic content and progressive response loading - Update CHANGELOG.md to document breaking changes and improvements This addresses the core issue with complex HTML parsing by requesting structured JSON responses from chatbots, making response extraction much more reliable and accurate.
-
nextime authored
- Add olproxy.py: Python proxy server bridging web chatbots to Ollama API - Add README.md: Comprehensive documentation with logo, usage examples, and API reference - Add CHANGELOG.md: Structured changelog following Keep a Changelog format - Add LICENSE: GPLv3 license with copyright attribution to Stefy Lanza - Add olproxy.jpg: Project logo - All files include proper GPLv3 licensing and attribution
-