fix(gateway): honor proxy env vars in SMS, Slack, Teams, and Google Chat adapters#26657
Closed
EloquentBrush0x wants to merge 1 commit into
Closed
Conversation
…eams, Google Chat adapters aiohttp.ClientSession defaults to trust_env=False, which silently ignores HTTP_PROXY, HTTPS_PROXY, and ALL_PROXY environment variables. Users behind a corporate or network proxy cannot reach external APIs on any of these platforms — all outbound requests fail with connection errors. Symmetric with wecom.py (line 276), weixin.py (lines 1055/1268/1274), and matrix.py (no-proxy path) which already set this flag. Complements the open LINE fix (NousResearch#26635) with the remaining gateway and plugin adapters. Changed: - gateway/platforms/sms.py: persistent Twilio session (connect) + fallback session (send) — both hit https://api.twilio.com - gateway/platforms/slack.py: ephemeral response_url POST session — hits https://hooks.slack.com/... callback URLs - plugins/platforms/teams/adapter.py: standalone send session — hits login.microsoftonline.com (token) + Bot Framework service URL - plugins/platforms/google_chat/adapter.py: standalone send session — hits https://chat.googleapis.com/v1/... WhatsApp sessions are excluded: they connect to http://127.0.0.1:{port} (local bridge) and must not be routed through a system proxy.
teknium1
added a commit
that referenced
this pull request
May 17, 2026
…tors Adds release-note attribution mappings for 9 contributors from group 4: - @EloquentBrush0x (PR #26657) - @subtract0 (PR #25658) - @zwolniony (PR #26961) - @that-ambuj (PR #26582) - @zccyman (PR #25294) - @lidge-jun (PR #26814) - @phoenixshen (PR #26768) - @AhmetArif0 (PR #26635) - (francip already mapped from prior PR #26134 attribution) #27147 dropped from this batch — already landed on main as 4b17c24.
Contributor
|
Merged via PR #27308 — your commit was cherry-picked onto current |
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
…tors Adds release-note attribution mappings for 9 contributors from group 4: - @EloquentBrush0x (PR NousResearch#26657) - @subtract0 (PR NousResearch#25658) - @zwolniony (PR NousResearch#26961) - @that-ambuj (PR NousResearch#26582) - @zccyman (PR NousResearch#25294) - @lidge-jun (PR NousResearch#26814) - @phoenixshen (PR NousResearch#26768) - @AhmetArif0 (PR NousResearch#26635) - (francip already mapped from prior PR NousResearch#26134 attribution) NousResearch#27147 dropped from this batch — already landed on main as 4b17c24.
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
aiohttp.ClientSessiondefaults totrust_env=False, which silently ignoresHTTP_PROXY,HTTPS_PROXY, andALL_PROXYenvironment variables. Users behind a corporate or network proxy cannot reach external APIs — all outbound requests fail with connection errors, with no indication that the proxy is the cause.Symmetric with
wecom.py(line 276),weixin.py(lines 1055/1268/1274), andmatrix.py(no-proxy path) which already set this flag. Complements the open LINE fix (#26635) with the remaining gateway and plugin adapters.Root cause
Every affected session is constructed without
trust_env=True:gateway/platforms/sms.pyconnect) + fallback session (send) — both hithttps://api.twilio.comgateway/platforms/slack.pyhttps://hooks.slack.com/…callback URLsplugins/platforms/teams/adapter.pylogin.microsoftonline.com(token) then Bot Framework service URLplugins/platforms/google_chat/adapter.pyhttps://chat.googleapis.com/v1/…Changes
gateway/platforms/sms.py:trust_env=Trueon the persistent Twilio session inconnect()and on the fallback session insend().gateway/platforms/slack.py:trust_env=Trueon the ephemeralresponse_urlPOST session.plugins/platforms/teams/adapter.py:trust_env=Trueon the standalone-send session.plugins/platforms/google_chat/adapter.py:trust_env=Trueon the standalone-send session.WhatsApp sessions are intentionally excluded — they connect to
http://127.0.0.1:{bridge_port}(local bridge process) and must not be routed through a system proxy.Validation
tests/gateway/test_sms.py: 39/39 pass (sequential,-n1; xdist port-binding race is pre-existing)tests/gateway/test_slack.py: all passtests/gateway/test_google_chat.py: standalone-send tests fail due togoogle-authnot installed in the local venv — identical failure onmainwithout this PR (pre-existing env issue, not introduced here)tests/gateway/test_teams.py: same pre-existing env skip as Google Chattrust_env=Trueis a no-op when no proxy env vars are set)