Skip to content

The agent that grows with you

feat(plugins): wire plugin platform handlers into a2a, buzz, and qqbot adapters

Teknium34393c32aab9
diff --git a/gateway/platforms/qqbot/adapter.py b/gateway/platforms/qqbot/adapter.py
index e36eacd2e0d..d84ab460148 100644
--- a/gateway/platforms/qqbot/adapter.py
+++ b/gateway/platforms/qqbot/adapter.py
@@ -363,6 +363,8 @@ class QQAdapter(BasePlatformAdapter):
self._heartbeat_task = asyncio.create_task(self._heartbeat_loop())
self._mark_connected()
logger.info("[%s] Connected", self._log_tag)
+ # Plugin-registered native handlers (ctx.register_platform_handler).
+ self._wire_plugin_handlers(None)
return True
except Exception as exc:
message = f"QQ startup failed: {exc}"
diff --git a/plugins/platforms/a2a/adapter.py b/plugins/platforms/a2a/adapter.py
index e54fa659ab6..79842c88c67 100644
--- a/plugins/platforms/a2a/adapter.py
+++ b/plugins/platforms/a2a/adapter.py
@@ -445,6 +445,8 @@ class A2AAdapter(BasePlatformAdapter):
"A2A: serving Agent Card + JSON-RPC on http://%s:%s (%s) as %r; %d routed agent(s)",
self.host, self.port, exposure, self.agent_name, len(self._agents),
)
+ # Plugin-registered native handlers (ctx.register_platform_handler).
+ self._wire_plugin_handlers(None)
return True
async def disconnect(self) -> None:
diff --git a/plugins/platforms/buzz/adapter.py b/plugins/platforms/buzz/adapter.py
index 8b77ae33412..dcb1ac3d8d1 100644
--- a/plugins/platforms/buzz/adapter.py
+++ b/plugins/platforms/buzz/adapter.py
@@ -565,6 +565,8 @@ class BuzzAdapter(BasePlatformAdapter):
transport_used,
"" if transport_used == "websocket" else f", poll interval {self.poll_interval:.1f}s",
)
+ # Plugin-registered native handlers (ctx.register_platform_handler).
+ self._wire_plugin_handlers(None)
return True
async def disconnect(self) -> None:
diff --git a/tests/gateway/test_platform_plugin_handlers.py b/tests/gateway/test_platform_plugin_handlers.py
index 663033ba702..9ca29237a80 100644
--- a/tests/gateway/test_platform_plugin_handlers.py
+++ b/tests/gateway/test_platform_plugin_handlers.py
@@ -241,7 +241,7 @@ def test_all_connectable_adapters_wire_plugin_handlers():
str(repo / "gateway" / "platforms" / name)
for name in (
"api_server.py", "bluebubbles.py", "msgraph_webhook.py",
- "signal.py", "webhook.py", "weixin.py",
+ "qqbot/adapter.py", "signal.py", "webhook.py", "weixin.py",
"whatsapp_cloud.py", "yuanbao.py",
)
]