Skip to content

Conversation

@abhishekpatil4
Copy link
Collaborator

@abhishekpatil4 abhishekpatil4 commented Apr 24, 2025

Sweep Summary Sweep

Fixed the get_connection() method in the Composio SDK client to correctly select the latest connected account by taking the first matching account instead of comparing creation dates.

  • Simplified the logic in python/composio/client/__init__.py by removing the datetime comparison and using the first matching account as the latest one.
  • Removed unnecessary code that was incorrectly comparing creation dates (it was actually selecting the oldest account, not the latest).
  • Added a break statement to exit the loop once a matching account is found, improving performance.

Ask Sweep AI questions about this PR

  • Fixed the logic in get_connection() method to get the latest connected account ID

@vercel
Copy link

vercel bot commented Apr 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
composio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 24, 2025 5:59pm

@entelligence-ai-pr-reviews
Copy link

LGTM 👍

Comment on lines +345 to +346
latest_account = connected_account
break
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to sort the list of connected account by the creation date in reverse fir this logic to work

@angrybayblade
Copy link
Contributor

marking stale

@CryogenicPlanet CryogenicPlanet deleted the fix/py-sdk branch October 28, 2025 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants