@devries-cameron20 / composio Mirror · read-only / commits / 2fa3f3d95
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.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 22, 14:30 UTC

fix(ts/cli): address cursorbot

jkomyno committed Jan 15, 2026 at 16:50 UTC 2fa3f3d95fb2b8ac5385ca232dd7b539255e4221
1 file changed +16 -7
ts/packages/cli/src/services/composio-clients.ts
+16 -7
@@ -30,6 +30,7 @@ import { renderPrettyError } from './utils/pretty-error';
30 */
31 export class HttpServerError extends Data.TaggedError('services/HttpServerError')<{
32 readonly cause?: unknown;
33 + readonly status?: number;
34 }> {}
35
36 /**
@@ -169,6 +170,7 @@ const handleHttpErrorResponse = (response: Response): Effect.Effect<never, HttpS
170 return yield* Effect.fail(
171 new HttpServerError({
172 cause: `HTTP ${status}\n${pretty}`,
173 + status,
174 })
175 );
176 }
@@ -178,6 +180,7 @@ const handleHttpErrorResponse = (response: Response): Effect.Effect<never, HttpS
180 return yield* Effect.fail(
181 new HttpServerError({
182 cause: `HTTP ${status} ${statusText}`,
183 + status,
184 })
185 );
186 });
@@ -613,13 +616,19 @@ export class ComposioToolkitsRepository extends Effect.Service<ComposioToolkitsR
616 Effect.all(
617 slugs.map(slug =>
618 client.toolkits.retrieve(slug).pipe(
616 - Effect.catchTag('services/HttpServerError', () =>
617 - Effect.fail(
618 - new InvalidToolkitsError({
619 - invalidToolkits: [slug],
620 - availableToolkits: [],
621 - })
622 - )
619 + // Only convert 404 errors to InvalidToolkitsError.
620 + // Other HTTP errors (500, 401, network failures, etc.) should propagate as-is.
621 + Effect.catchTag('services/HttpServerError', e =>
622 + Effect.if(e.status === 404, {
623 + onTrue: () =>
624 + Effect.fail(
625 + new InvalidToolkitsError({
626 + invalidToolkits: [slug],
627 + availableToolkits: [],
628 + })
629 + ),
630 + onFalse: () => Effect.fail(e),
631 + })
632 )
633 )
634 ),