1. 23 Aug, 2025 10 commits
    • nextime's avatar
      Improve prompt to ensure complete response capture in base64 encoding · 2cf42f1e
      nextime authored
      - Add explicit step-by-step instructions for chatbot to follow
      - Emphasize waiting for COMPLETE response before JSON formatting
      - Use numbered list format for clarity and better compliance
      - Add example JSON format to reduce ambiguity
      - Separate user question clearly from formatting instructions
      - Address issue where chatbot was truncating responses before base64 encoding
      
      This should resolve the problem where the chatbot wasn't including
      the whole reply correctly in the base64 encoded response key.
      2cf42f1e
    • nextime's avatar
      Fix JavaScript string literal syntax error in array join · 0e320d63
      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
      0e320d63
    • nextime's avatar
      Fix JavaScript null pointer error in regex match chaining · c9f87350
      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
      c9f87350
    • nextime's avatar
      Fix JavaScript syntax errors in page.evaluate regex patterns · c101dd9f
      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.
      c101dd9f
    • nextime's avatar
      Increase page click timeout to 48 seconds (3 seconds more than reply timeout) · a5320424
      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.
      a5320424
    • nextime's avatar
      Implement base64 encoding for chatbot responses to avoid formatting issues · dd4e12a0
      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.
      dd4e12a0
    • nextime's avatar
      Enforce strict ID matching and complete JSON validation before serving responses · 9920f907
      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.
      9920f907
    • nextime's avatar
      Improve JSON response validation and increase timeout to 45 seconds · c0d398f4
      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.
      c0d398f4
    • nextime's avatar
      Implement improved JSON-based response detection system · 41cc9c97
      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.
      41cc9c97
    • nextime's avatar
      Initial commit: Add OLProxy with comprehensive documentation and GPLv3 licensing · 862ec611
      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
      862ec611