This clearly indicates that traffic to Google OAuth endpoints is not being captured by the TUN interface and is leaking as direct connections.
Root Cause Analysis (after extensive debugging)
-
agy backend has poor support for system proxy environment variables
SettingHTTP_PROXY/HTTPS_PROXY/ALL_PROXYdoes not reliably make the Go-basedagyprocess use the proxy. -
Using
socks5://protocol in environment variables breaks other tools (e.g. Claude Code / Node.js based extensions) withUnsupportedProxyProtocolerrors. -
TUN mode leakage caused by:
- Multiple virtual NICs (Hyper-V, WSL, VMware) competing for routing priority
- Windows preferring IPv6, which often bypasses the TUN virtual adapter
- xray TUN core having weaker compatibility with complex multi-NIC environments compared to sing-box
-
Residual proxy environment variables also caused system-wide network issues (browser disconnection).
Final Working Solution
After long debugging, the following combination resolved the issue:
| Action | Details | Purpose |
|---|---|---|
| Switch TUN core | Change from xray to sing-box in v2rayN Tun settings | Better compatibility with Hyper-V / VMware virtual adapters |
| Run as Administrator | Completely exit v2rayN and relaunch as Administrator | Ensure Wintun driver is properly created and activated |
| Disable IPv6 | Uncheck “Internet Protocol Version 6 (TCP/IPv6)” on the physical WLAN adapter | Prevent Windows from preferring IPv6 direct connections that leak past TUN |
| Clean environment variables | Completely remove HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, NO_PROXY from both User and System variables |
Avoid protocol conflicts with Node.js tools and residual pollution |
| Routing rules | Set to “Bypass Mainland China” | Google / Gemini traffic goes through proxy; domestic services stay direct |
With the above configuration, the agy backend can successfully complete OAuth and the sidebar works normally. Other tools (Claude Code, etc.) also work without protocol errors.
Suggestions
- Improve the
agybackend’s support for standard system proxy environment variables and common proxy software (especially TUN mode). - Provide clearer error messages in the VS Code sidebar instead of a silent black screen when the local daemon fails to connect to Google services.
- Add official documentation about network requirements and recommended proxy configurations (especially for users behind restricted networks or complex multi-NIC setups).
Happy to provide more logs or additional details if needed.
Thank you!