feat(gateway): unified proxy support for Discord and Telegram with macOS auto-detection#6562
Closed
nocoo wants to merge 1 commit into
Closed
feat(gateway): unified proxy support for Discord and Telegram with macOS auto-detection#6562nocoo wants to merge 1 commit into
nocoo wants to merge 1 commit into
Conversation
…cOS auto-detection - Add resolve_proxy_url() to base.py — shared by all platform adapters - Check HTTPS_PROXY / HTTP_PROXY / ALL_PROXY env vars first - Fall back to macOS system proxy via scutil --proxy (zero-config) - Pass proxy= to discord.py commands.Bot() for gateway connectivity - Refactor telegram_network.py to use shared resolver - Update test fixtures to accept proxy kwarg
1 task
teknium1
added a commit
that referenced
this pull request
Apr 9, 2026
… proxy coverage Follow-up improvements on top of the shared resolver from PR #6562: - Add platform_env_var parameter to resolve_proxy_url() so DISCORD_PROXY takes priority over generic HTTPS_PROXY/ALL_PROXY env vars - Add SOCKS proxy support via aiohttp_socks.ProxyConnector with rdns=True (critical for GFW/Shadowrocket/Clash users — issue #6649) - proxy_kwargs_for_bot() returns connector= for SOCKS, proxy= for HTTP - proxy_kwargs_for_aiohttp() returns split (session_kw, request_kw) for standalone aiohttp sessions - Add proxy support to send_message_tool.py (Discord REST, Slack, SMS) for cron job delivery behind proxies (from PR #2208) - Add proxy support to Discord image/document downloads - Fix duplicate import sys in base.py
teknium1
added a commit
that referenced
this pull request
Apr 9, 2026
… proxy coverage Follow-up improvements on top of the shared resolver from PR #6562: - Add platform_env_var parameter to resolve_proxy_url() so DISCORD_PROXY takes priority over generic HTTPS_PROXY/ALL_PROXY env vars - Add SOCKS proxy support via aiohttp_socks.ProxyConnector with rdns=True (critical for GFW/Shadowrocket/Clash users — issue #6649) - proxy_kwargs_for_bot() returns connector= for SOCKS, proxy= for HTTP - proxy_kwargs_for_aiohttp() returns split (session_kw, request_kw) for standalone aiohttp sessions - Add proxy support to send_message_tool.py (Discord REST, Slack, SMS) for cron job delivery behind proxies (from PR #2208) - Add proxy support to Discord image/document downloads - Fix duplicate import sys in base.py
Contributor
Tommyeds
pushed a commit
to Tommyeds/hermes-agent
that referenced
this pull request
Apr 12, 2026
… proxy coverage Follow-up improvements on top of the shared resolver from PR NousResearch#6562: - Add platform_env_var parameter to resolve_proxy_url() so DISCORD_PROXY takes priority over generic HTTPS_PROXY/ALL_PROXY env vars - Add SOCKS proxy support via aiohttp_socks.ProxyConnector with rdns=True (critical for GFW/Shadowrocket/Clash users — issue NousResearch#6649) - proxy_kwargs_for_bot() returns connector= for SOCKS, proxy= for HTTP - proxy_kwargs_for_aiohttp() returns split (session_kw, request_kw) for standalone aiohttp sessions - Add proxy support to send_message_tool.py (Discord REST, Slack, SMS) for cron job delivery behind proxies (from PR NousResearch#2208) - Add proxy support to Discord image/document downloads - Fix duplicate import sys in base.py
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 28, 2026
… proxy coverage Follow-up improvements on top of the shared resolver from PR NousResearch#6562: - Add platform_env_var parameter to resolve_proxy_url() so DISCORD_PROXY takes priority over generic HTTPS_PROXY/ALL_PROXY env vars - Add SOCKS proxy support via aiohttp_socks.ProxyConnector with rdns=True (critical for GFW/Shadowrocket/Clash users — issue NousResearch#6649) - proxy_kwargs_for_bot() returns connector= for SOCKS, proxy= for HTTP - proxy_kwargs_for_aiohttp() returns split (session_kw, request_kw) for standalone aiohttp sessions - Add proxy support to send_message_tool.py (Discord REST, Slack, SMS) for cron job delivery behind proxies (from PR NousResearch#2208) - Add proxy support to Discord image/document downloads - Fix duplicate import sys in base.py
ulasbilgen
pushed a commit
to ulasbilgen/hermes-adhd-agent
that referenced
this pull request
May 1, 2026
… proxy coverage Follow-up improvements on top of the shared resolver from PR NousResearch#6562: - Add platform_env_var parameter to resolve_proxy_url() so DISCORD_PROXY takes priority over generic HTTPS_PROXY/ALL_PROXY env vars - Add SOCKS proxy support via aiohttp_socks.ProxyConnector with rdns=True (critical for GFW/Shadowrocket/Clash users — issue NousResearch#6649) - proxy_kwargs_for_bot() returns connector= for SOCKS, proxy= for HTTP - proxy_kwargs_for_aiohttp() returns split (session_kw, request_kw) for standalone aiohttp sessions - Add proxy support to send_message_tool.py (Discord REST, Slack, SMS) for cron job delivery behind proxies (from PR NousResearch#2208) - Add proxy support to Discord image/document downloads - Fix duplicate import sys in base.py
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
… proxy coverage Follow-up improvements on top of the shared resolver from PR NousResearch#6562: - Add platform_env_var parameter to resolve_proxy_url() so DISCORD_PROXY takes priority over generic HTTPS_PROXY/ALL_PROXY env vars - Add SOCKS proxy support via aiohttp_socks.ProxyConnector with rdns=True (critical for GFW/Shadowrocket/Clash users — issue NousResearch#6649) - proxy_kwargs_for_bot() returns connector= for SOCKS, proxy= for HTTP - proxy_kwargs_for_aiohttp() returns split (session_kw, request_kw) for standalone aiohttp sessions - Add proxy support to send_message_tool.py (Discord REST, Slack, SMS) for cron job delivery behind proxies (from PR NousResearch#2208) - Add proxy support to Discord image/document downloads - Fix duplicate import sys in base.py
olympus-terminal
pushed a commit
to olympus-terminal/hermes-agent
that referenced
this pull request
May 16, 2026
… proxy coverage Follow-up improvements on top of the shared resolver from PR NousResearch#6562: - Add platform_env_var parameter to resolve_proxy_url() so DISCORD_PROXY takes priority over generic HTTPS_PROXY/ALL_PROXY env vars - Add SOCKS proxy support via aiohttp_socks.ProxyConnector with rdns=True (critical for GFW/Shadowrocket/Clash users — issue NousResearch#6649) - proxy_kwargs_for_bot() returns connector= for SOCKS, proxy= for HTTP - proxy_kwargs_for_aiohttp() returns split (session_kw, request_kw) for standalone aiohttp sessions - Add proxy support to send_message_tool.py (Discord REST, Slack, SMS) for cron job delivery behind proxies (from PR NousResearch#2208) - Add proxy support to Discord image/document downloads - Fix duplicate import sys in base.py
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
… proxy coverage Follow-up improvements on top of the shared resolver from PR NousResearch#6562: - Add platform_env_var parameter to resolve_proxy_url() so DISCORD_PROXY takes priority over generic HTTPS_PROXY/ALL_PROXY env vars - Add SOCKS proxy support via aiohttp_socks.ProxyConnector with rdns=True (critical for GFW/Shadowrocket/Clash users — issue NousResearch#6649) - proxy_kwargs_for_bot() returns connector= for SOCKS, proxy= for HTTP - proxy_kwargs_for_aiohttp() returns split (session_kw, request_kw) for standalone aiohttp sessions - Add proxy support to send_message_tool.py (Discord REST, Slack, SMS) for cron job delivery behind proxies (from PR NousResearch#2208) - Add proxy support to Discord image/document downloads - Fix duplicate import sys in base.py
Egavasyug
pushed a commit
to Egavasyug/hermes-agent
that referenced
this pull request
Jun 10, 2026
… proxy coverage Follow-up improvements on top of the shared resolver from PR NousResearch#6562: - Add platform_env_var parameter to resolve_proxy_url() so DISCORD_PROXY takes priority over generic HTTPS_PROXY/ALL_PROXY env vars - Add SOCKS proxy support via aiohttp_socks.ProxyConnector with rdns=True (critical for GFW/Shadowrocket/Clash users — issue NousResearch#6649) - proxy_kwargs_for_bot() returns connector= for SOCKS, proxy= for HTTP - proxy_kwargs_for_aiohttp() returns split (session_kw, request_kw) for standalone aiohttp sessions - Add proxy support to send_message_tool.py (Discord REST, Slack, SMS) for cron job delivery behind proxies (from PR NousResearch#2208) - Add proxy support to Discord image/document downloads - Fix duplicate import sys in base.py
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
Add a shared
resolve_proxy_url()helper inbase.pythat resolves HTTP proxy URLs for gateway platform adapters. Discord and Telegram both use it.Resolution order:
HTTPS_PROXY,HTTP_PROXY,ALL_PROXY(+ lowercase)scutil --proxy(zero-config fallback)Changes
gateway/platforms/base.py— addresolve_proxy_url()+_detect_macos_system_proxy()gateway/platforms/discord.py— passproxy=tocommands.Bot()gateway/platforms/telegram_network.py— delegate to shared resolvertests/gateway/test_discord_connect.py— update mock to acceptproxykwargMotivation
Discord gateway connections fail in proxied environments (GFW, corporate firewalls) because the adapter never passed a proxy to the underlying
discord.pyclient. The Telegram adapter had env-var-based proxy support but duplicated the logic locally.This PR unifies both into a single resolver and adds macOS system proxy auto-detection — users with a system proxy configured get Discord/Telegram connectivity without setting any env vars.
Supersedes #6052, #6184. Related: #2208, #5454.
Testing
test_discord_connect.py— 4 tests passtest_telegram_network.py— 45 tests passscutil --proxyreturning127.0.0.1:7890: Discord bot reconnects successfully through proxy