@devries-cameron20 / composio-1 / commits / eb6564924
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

fix(py): address python comments

jkomyno committed Feb 6, 2026 at 20:32 UTC eb6564924e7c4e3d0bb90362fd2728c21a83a731
2 files changed +15 -1
python/composio/core/models/webhook_events.py
+11 -1
@@ -17,6 +17,7 @@ class WebhookEventType(str, Enum):
17 """Known webhook event types."""
18
19 CONNECTION_EXPIRED = "composio.connected_account.expired"
20 + TRIGGER_MESSAGE = "composio.trigger.message"
21
22
23 class ConnectionStatusEnum(str, Enum):
@@ -102,6 +103,13 @@ class SingleConnectedAccountDetailedResponse(te.TypedDict, total=False):
103 Connected account data matching GET /api/v3/connected_accounts/{id} response.
104
105 This is used in webhook payloads for connection lifecycle events.
106 + It intentionally does NOT reuse composio_client's ConnectedAccountRetrieveResponse
107 + because webhook payloads arrive in raw snake_case format, while the SDK client
108 + transforms responses to a different shape. This TypedDict validates the raw
109 + webhook payload directly without any transformation layer.
110 +
111 + See Also:
112 + composio_client.types.connected_account_retrieve_response for the SDK version.
113 """
114
115 toolkit: te.Required[ConnectedAccountToolkit]
@@ -155,7 +163,9 @@ class ConnectionExpiredEvent(te.TypedDict):
163 metadata: WebhookConnectionMetadata
164
165
158 -# Type alias for all webhook events
166 +# Type alias for non-trigger webhook events with specific typed schemas.
167 +# Trigger events (composio.trigger.message) are handled through the
168 +# TriggerEvent type in triggers.py via the trigger subscription system.
169 WebhookEvent = t.Union[ConnectionExpiredEvent]
170
171
python/tests/test_webhook_events.py
+4
@@ -19,6 +19,10 @@ class TestWebhookEventType:
19 == "composio.connected_account.expired"
20 )
21
22 + def test_trigger_message_value(self) -> None:
23 + """Should have correct value for TRIGGER_MESSAGE."""
24 + assert WebhookEventType.TRIGGER_MESSAGE.value == "composio.trigger.message"
25 +
26
27 class TestIsConnectionExpiredEvent:
28 """Tests for is_connection_expired_event helper function."""