getUserInfoViaProxy (used by COMPOSIO_MANAGE_CONNECTIONS + post-search enrichment in COMPOSIO_SEARCH_TOOLS) and the getToolkitConnectedAccountUserInfoRPC only need a toolkit's getCurrentUserEndpoint string to fire the user-info probe. Both were calling getExtendedToolkitBySlug, which fans out to 4 calls per toolkit (Thermos retrieveToolkit + DB_TOOLKIT_FIND + DB_DEFAULT_AUTH_CONFIG_FIND + LD isServiceAuthSchemeEnabled) and runs FieldsGenerator.generateFieldsForToolkit across ~13 auth schemes — then discards everything except the endpoint string.
Two changes:
Add resolveCurrentUserEndpointForToolkit(slug, projectAutoId) in apps/apollo/src/lib/toolkits/get_toolkits_by_slug.ts. It calls toolsApiGetAppInfo once and runs the same getBestPossibleUrlWithoutAuthInfo template substitution as the heavy path (filtering out deprecated/experimental schemes, matching getExtendedToolkitBySlug(..., false)). Drops the 2 Postgres roundtrips + LD + field generation. Wire it into both call sites: getUserInfoViaProxy (composio_actions/utils/connections.ts) and getCurrentUserInfoRPC (toolRouterV2/features/connections/getCurrentUserInfoRPC.ts).
Parallelize the 3 independent upstream lookups in getCurrentUserInfoRPC (getToolRouterSession, getToolkitsForToolRouterSession, resolveCurrentUserEndpointForToolkit) via Promise.all instead of running them sequentially. Saves ~80-150ms on the critical path before the proxy call.
Production signal. A representative slow COMPOSIO_MANAGE_CONNECTIONS (964ms p90, prod trace 3d8e11ffd0f1bb3ebb6a8cac88baedc6) shows 9 parallel getUserInfoViaProxy calls each blocked on getExtendedToolkitBySlug for ~83ms before firing the proxy probe; the fan-out also makes 18 redundant Postgres roundtrips per request for data the caller never reads. The lighter helper drops those queries, and on the getCurrentUserInfoRPC path the parallelization removes a serial 80-150ms Thermos hop from the critical path.
Behavior parity preserved. Same Thermos call (toolsApiGetAppInfo), same template substitution via getBestPossibleUrlWithoutAuthInfo, same scheme filtering. The new helper handles the same edge cases (missing get_current_user_endpoint, error propagation).
New unit tests (5 in apps/apollo/src/lib/toolkits/get_toolkits_by_slug.test.ts):
undefined when toolkit has no get_current_user_endpointgetExtendedToolkitBySlug(..., false))toolsApiGetAppInfo (no DB / LD fan-out)Scoped existing tests (all green):
connections_dcr_oauth.test.ts, connections_auth_config_enabled_filter.test.ts, manageConnections.test.ts, manageConnections.unit.test.ts — 56 testssearchRace.test.ts, search_action_multi_account.unit.test.ts, waitForConnection.test.ts — 43 testsgetCurrentUserInfoRPC.test.ts — 5 tests$ doppler run -- pnpm with-env vitest run \
src/lib/toolkits/get_toolkits_by_slug.test.ts \
src/lib/composio_actions/utils/__tests__/connections_dcr_oauth.test.ts \
src/lib/composio_actions/utils/__tests__/connections_auth_config_enabled_filter.test.ts \
src/lib/composio_actions/actions/manageConnections.test.ts \
src/lib/composio_actions/actions/toolRouter/__tests__/manageConnections.unit.test.ts \
src/lib/composio_actions/actions/__tests__/searchRace.test.ts \
src/lib/composio_actions/actions/__tests__/search_action_multi_account.unit.test.ts \
src/lib/composio_actions/actions/toolRouter/__tests__/waitForConnection.test.ts \
src/lib/toolRouterV2/features/connections/getCurrentUserInfoRPC.test.ts
# Test Files 9 passed, Tests 109 passed
pnpm check-types on apollo: clean.
E2E against running local Apollo:
webflow enabled → trs_FFHy-bTbXhRY.ac_fKJy4sdXhgv9) and connected account (ca_xnSyUGDln_N-), then flipped isToolRouterConfig = true so the bulk fetch picks it up.POST .../execute_meta with COMPOSIO_MANAGE_CONNECTIONS → returns active connection. Apollo logs confirm the new helper resolves the endpoint correctly:
Fetching user info for webflow using endpoint:
https://api.webflow.com/v2/token/authorized_by
POST .../execute_meta with COMPOSIO_SEARCH_TOOLS → 200 (search-action user-info path also exercised).Origin: cron-1b67184aec75 / zen-cron-b5afd99a4235 Triggered by: dhawal@composio.dev | Source: unknown Session: https://zen-api-production-4c98.up.railway.app/dashboard/#/chat/zen-cron-b5afd99a4235
🤖 Generated with Claude Code
Based on git blame analysis of 4 file(s):
| Contributor | Contribution | Files |
|---|---|---|
| Zen | 34% | 4 |
| lingalarahul7 | 27% |
| 3 |
| Dhawal Upadhyay | 15% | 1 |
| Himanshu Dixit | 14% | 3 |
| Rohan Prabhu | 2% | 1 |
Recommend Zen — they made the most recent edits across multiple changed files (today) and can provide quick context and spot regressions. Also add lingalarahul7 — they’ve been a major contributor to the toolkit and connections files and can review design/implementation details.
🤖 Based on git blame with recency weighting (recent edits count more).
:x: Patch coverage is 77.77778% with 8 lines in your changes missing coverage. Please review.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| ...erV2/features/connections/getCurrentUserInfoRPC.ts | 28.57% | 5 Missing :warning: |
| ...ollo/src/lib/composio_actions/utils/connections.ts | 25.00% | 3 Missing :warning: |
| Flag | Coverage Δ | |
|---|---|---|
| e2e-tests | 5.82% <0.00%> (?) | |
| self-hosted-tests | 5.64% <2.77%> (+<0.01%) | :arrow_up: |
| thermos-unit-tests | ? | |
| unit-tests | 58.77% <77.77%> (+<0.01%) | :arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Files with missing lines | Coverage Δ | |
|---|---|---|
| ...ps/apollo/src/lib/toolkits/get_toolkits_by_slug.ts | 94.04% <100.00%> (+0.33%) | :arrow_up: |
| ...ollo/src/lib/composio_actions/utils/connections.ts | 59.39% <25.00%> (+0.11%) | :arrow_up: |
| ...erV2/features/connections/getCurrentUserInfoRPC.ts | 67.12% <28.57%> (+1.30%) | :arrow_up: |
... and 337 files with indirect coverage changes