Skip to content

Fix VPN WebSocket Timeouts and optimize Setup.py#8

Open
rahmonovme wants to merge 3 commits into
FatihMakes:mainfrom
rahmonovme:main
Open

Fix VPN WebSocket Timeouts and optimize Setup.py#8
rahmonovme wants to merge 3 commits into
FatihMakes:mainfrom
rahmonovme:main

Conversation

@rahmonovme
Copy link
Copy Markdown

📝 Summary of Changes

1. 🛡️ VPN & Proxy Stability Fixes (main.py)

  • Encoding Crash Fixed: Fixed the UnicodeEncodeError when printing emojis on standard Windows consoles by automatically configuring sys.stdout to use utf-8.
  • Python 3.10 Compatibility: Upgraded asyncio.TaskGroup() (which only works in Python 3.11+) to use asyncio.gather(). This ensures the assistant remains fully backwards compatible with Python 3.10.
  • WebSocket Timeouts Resolved: Refactored the live audio WebSocket connection protocols and increased connection timeout limits to 60s. Added a safe network patch to enforce socks5h remote DNS routing. This completely resolves the "Handshake Timeout" and "Scheme socks isn't supported" errors that occur when users run the assistant behind standard VPNs or Proxies.

2. ⚡ Automated & Faster Setup (setup.py & requirements.txt)

  • Instant uv Installation: The setup.py script now automatically creates the venv and immediately uses the ultra-fast uv package manager for dependency resolution, entirely preventing native pip backtracking loops.
  • Smart Terminal Hints: Setup now gracefully outputs dynamic, cross-platform terminal hints telling the user exactly how to activate their venv.
  • Proxy Routing Libraries: Added python-socks[asyncio] and httpx[socks] to requirements.txt to support the network fixes natively.

3. 🌍 Open-Source Standards

  • Privacy Protection: Created a .gitignore file to ensure users don't accidentally push their secret config/api_keys.json or local venv/ binaries as they clone the project.
  • README Upgrade: Updated the Quick Start guide in README.md to accurately define the .venv activation steps for new users.

Copilot AI review requested due to automatic review settings April 18, 2026 17:50
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to improve reliability when running the assistant behind VPNs/proxies (WebSocket timeouts, SOCKS proxy handling) and streamline local setup by creating/using a virtual environment with faster dependency installation.

Changes:

  • Monkeypatch WebSocket connection defaults and proxy resolution behavior to reduce VPN/proxy handshake failures; replace TaskGroup with asyncio.gather() for Python 3.10 compatibility.
  • Update setup.py to create/use venv, install dependencies via uv, and print activation/run instructions.
  • Add SOCKS-related dependencies, update README quick start commands, and introduce a .gitignore to prevent committing secrets/venvs.

Reviewed changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
main.py Adds WebSocket/proxy patches, stdout UTF-8 configuration, and replaces TaskGroup with gather() in the live session loop.
setup.py Automates venv creation and installs requirements using uv, then installs Playwright browsers and prints usage hints.
requirements.txt Adds SOCKS/proxy-related dependencies and normalizes Pillow casing.
readme.md Updates quick start clone/cd commands and adds venv activation steps.
.gitignore Prevents committing caches, venvs, and API key config files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread setup.py
Comment thread readme.md
Comment thread setup.py Outdated
Comment thread main.py Outdated
Comment thread main.py Outdated
Comment thread main.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants