mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
feat(gateway): unified proxy support for Discord and Telegram with macOS 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
This commit is contained in:
parent
88845b99d2
commit
88dbbfe982
4 changed files with 68 additions and 8 deletions
|
|
@ -56,7 +56,7 @@ class FakeTree:
|
|||
|
||||
|
||||
class FakeBot:
|
||||
def __init__(self, *, intents):
|
||||
def __init__(self, *, intents, proxy=None):
|
||||
self.intents = intents
|
||||
self.user = SimpleNamespace(id=999, name="Hermes")
|
||||
self._events = {}
|
||||
|
|
@ -95,7 +95,7 @@ async def test_connect_only_requests_members_intent_when_needed(monkeypatch, all
|
|||
|
||||
created = {}
|
||||
|
||||
def fake_bot_factory(*, command_prefix, intents):
|
||||
def fake_bot_factory(*, command_prefix, intents, proxy=None):
|
||||
created["bot"] = FakeBot(intents=intents)
|
||||
return created["bot"]
|
||||
|
||||
|
|
@ -124,7 +124,7 @@ async def test_connect_releases_token_lock_on_timeout(monkeypatch):
|
|||
monkeypatch.setattr(
|
||||
discord_platform.commands,
|
||||
"Bot",
|
||||
lambda **kwargs: FakeBot(intents=kwargs["intents"]),
|
||||
lambda **kwargs: FakeBot(intents=kwargs["intents"], proxy=kwargs.get("proxy")),
|
||||
)
|
||||
|
||||
async def fake_wait_for(awaitable, timeout):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue