Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

next
ts 20 lines 837 Bytes
Raw
1 import type { ComposioRequestOptions } from '../types/requestOptions.types';
2
3 /**
4 * Request options for a call that executes a tool or proxies an API call: the
5 * caller's options with retries disabled.
6 *
7 * These calls are non-idempotent writes. The client retries timeouts,
8 * connection errors, and 408/409/429/5xx responses by default, and a retry
9 * after the backend already acted duplicates the side effect (e.g. sends the
10 * same email twice). The backend does not deduplicate executions, so every
11 * execution path must go through this helper. Reads keep the default retries.
12 * See https://github.com/ComposioHQ/composio/issues/3654.
13 *
14 * @internal
15 */
16 export function withoutRetries(
17 requestOptions?: ComposioRequestOptions
18 ): ComposioRequestOptions & { maxRetries: 0 } {
19 return { ...requestOptions, maxRetries: 0 };
20 }