Fix VPN WebSocket Timeouts and optimize Setup.py#8
Open
rahmonovme wants to merge 3 commits into
Open
Conversation
There was a problem hiding this comment.
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
TaskGroupwithasyncio.gather()for Python 3.10 compatibility. - Update
setup.pyto create/usevenv, install dependencies viauv, and print activation/run instructions. - Add SOCKS-related dependencies, update README quick start commands, and introduce a
.gitignoreto 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.
… virtual environment activation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Summary of Changes
1. 🛡️ VPN & Proxy Stability Fixes (
main.py)UnicodeEncodeErrorwhen printing emojis on standard Windows consoles by automatically configuringsys.stdoutto useutf-8.asyncio.TaskGroup()(which only works in Python 3.11+) to useasyncio.gather(). This ensures the assistant remains fully backwards compatible with Python 3.10.60s. Added a safe network patch to enforcesocks5hremote 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)uvInstallation: Thesetup.pyscript now automatically creates thevenvand immediately uses the ultra-fastuvpackage manager for dependency resolution, entirely preventing nativepipbacktracking loops.venv.python-socks[asyncio]andhttpx[socks]torequirements.txtto support the network fixes natively.3. 🌍 Open-Source Standards
.gitignorefile to ensure users don't accidentally push their secretconfig/api_keys.jsonor localvenv/binaries as they clone the project.README.mdto accurately define the.venvactivation steps for new users.