Hey team! Thanks for the automated review — both points are valid. Here's our plan:
1. JSON output inconsistency (connections.cmd.ts) — Good catch. The empty case was emitting { items: [], total: 0 } while the non-empty case emits a plain array via formatConnectedAccountsJson. We'll fix this to use the same format function in both paths.
2. Pipeline duplication between apps.cmd.ts and toolkits.list.cmd.ts — This is a fair concern. Rather than having two copies of the fetch-catalog → resolve-session → merge → filter pipeline that will inevitably drift, we'd like to extract the shared logic into a reusable helper that both commands call, parameterized by user ID resolution. Something like:
// Shared: fetch catalog + session toolkits, merge, optionally filter by connected
const fetchToolkitsWithStatus = (params: {
client: Composio;
userId: string;
query?: string;
limit: number;
cacheScope?: { orgId: string; consumerUserId: string };
}) => Effect.gen(function* () { /* ... */ })
Then composio apps calls it with the consumer user ID and composio dev toolkits list calls it with the developer test user ID. One place to fix bugs, zero drift.
This does mean touching the existing toolkits.list.cmd.ts to use the shared helper — we're happy to do that refactor, but since it touches working code we'd appreciate a thumbs-up from a maintainer before we go ahead. We want to make sure the scope feels right to you all.
Let us know how you'd like us to proceed! We'll push the JSON fix in the meantime.