Skip to content

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 wait connection

kaavee3150d482ee54043
diff --git a/python/composio/core/models/connected_accounts.py b/python/composio/core/models/connected_accounts.py
index e8439740a..3f9dade12 100644
--- a/python/composio/core/models/connected_accounts.py
+++ b/python/composio/core/models/connected_accounts.py
@@ -360,9 +360,16 @@ class ConnectedAccounts:
"""
Wait for connected account with given ID to be active
"""
- return ConnectionRequest.from_id(
- id=id, client=self._client
- ).wait_for_connection(
+ # Get the connection status first
+ connection = self._client.connected_accounts.retrieve(nanoid=id)
+ # Create a ConnectionRequest instance
+ connection_request = ConnectionRequest(
+ id=id,
+ status=connection.status,
+ redirect_url=None,
+ client=self._client,
+ )
+ return connection_request.wait_for_connection(
timeout=timeout,
)