From ae5e39005bde8deb989c2dda63959cce60bb4622 Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Wed, 8 Jul 2026 07:05:30 -0700 Subject: [PATCH] fix(gateway): run webhook route scripts off the event loop + AUTHOR_MAP entry - run_route_script shells out with subprocess.run (up to 30s timeout); wrap the call in asyncio.to_thread so a slow script can't stall every other webhook and gateway task on the loop. - scripts/release.py: map grace@weeb.onl -> evelynburger for the salvaged contributor commit. --- gateway/platforms/webhook.py | 8 ++++++-- scripts/release.py | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gateway/platforms/webhook.py b/gateway/platforms/webhook.py index 91cdcf325fa..e2e52a174f7 100644 --- a/gateway/platforms/webhook.py +++ b/gateway/platforms/webhook.py @@ -600,8 +600,12 @@ class WebhookAdapter(BasePlatformAdapter): ) if route_config.get("script"): - keep, transformed_payload = self._route_processor.run_route_script( - route_config.get("script"), payload + # run_route_script shells out (subprocess.run, up to its timeout); + # run it in a worker thread so it can't block the gateway event loop. + keep, transformed_payload = await asyncio.to_thread( + self._route_processor.run_route_script, + route_config.get("script"), + payload, ) if not keep: logger.info( diff --git a/scripts/release.py b/scripts/release.py index 51b2d93b75c..a73747398f0 100755 --- a/scripts/release.py +++ b/scripts/release.py @@ -45,6 +45,7 @@ ACP_REGISTRY_MANIFEST = REPO_ROOT / "acp_registry" / "agent.json" # Auto-extracted from noreply emails + manual overrides AUTHOR_MAP = { + "grace@weeb.onl": "evelynburger", # PR #57544 salvage (gateway: webhook payload filters + route scripts; commit under unlinked identity) "contato@siteup.com.br": "SiteupAgencia", # PR #57435 salvage (tui_gateway: back off notification poller when session is busy; #55578) "164521089+rainbowgits@users.noreply.github.com": "rainbowgore", # PR #59405 salvage (mcp: bound stdio initialize handshake to stop subprocess/FD leak; #59349) "sage@Sages-Mac-mini.local": "thestudionorth", # PR #60015 salvage (mcp: parent-death watchdog for stdio children; commit under unlinked local identity)