ComposioHQ/composio · warning · ComposioRequestCancelledError

ComposioRequestCancelledError

Error message

ComposioRequestCancelledError

What it means

ComposioRequestCancelledError thrown by applyBeforeExecuteModifiers when the AbortSignal in requestOptions is already aborted before tool execution modifiers run. This is a cooperative-cancellation mechanism: the SDK checks the signal at each stage and stops the pipeline early.

Source

Thrown at ts/packages/core/src/models/Tools.ts:273

   * @param modifier - The modifier to apply
   * @returns The modified params
   */
  private async applyBeforeExecuteModifiers(
    tool: Tool,
    {
      toolSlug,
      toolkitSlug,
      params,
    }: {
      toolSlug: string;
      toolkitSlug: string;
      params: ToolExecuteParams;
    },
    modifiers?: ExecuteToolModifiers,
    requestOptions?: ComposioRequestOptions
  ): Promise<ToolExecuteParams> {
    if (requestOptions?.signal?.aborted) {
      throw new ComposioRequestCancelledError();
    }
    let modifiedParams = await this.applyFileUploadModifiers(
      tool,
      { toolSlug, toolkitSlug, params },
      modifiers?.beforeFileUpload,
      requestOptions
    );

    // apply the before execute modifiers
    if (modifiers?.beforeExecute) {
      if (typeof modifiers.beforeExecute === 'function') {
        modifiedParams = await modifiers.beforeExecute({
          toolSlug,
          toolkitSlug,
          params: modifiedParams,
        });
        if (requestOptions?.signal?.aborted) {
          throw new ComposioRequestCancelledError();

View on GitHub (pinned to 64b1b85502)

Solutions

  1. Check signal.aborted before invoking execute and skip/wrap the call accordingly.
  2. Increase or remove the abort timeout if legitimate tool calls are being cancelled prematurely.
  3. Catch ComposioRequestCancelledError and map it to your framework's cancellation response (e.g. 499) rather than a generic failure.

Example fix

// before
const res = await tools.execute('GITHUB_STAR_REPO', params, {}, { signal: req.signal });

// after
if (req.signal.aborted) return; // client already gone
const res = await tools.execute('GITHUB_STAR_REPO', params, {}, { signal: req.signal });
Defensive patterns

Strategy: try-catch

Validate before calling

if (opts?.signal?.aborted) return skip('cancelled before execute');
await tools.execute(slug, params, {}, opts);

Type guard

const isCancelled = (e: unknown): e is ComposioRequestCancelledError =>
  e instanceof ComposioRequestCancelledError;

Try / catch

try {
  await tools.execute(...);
} catch (e) {
  if (e instanceof ComposioRequestCancelledError) return; // clean cancel
  throw e;
}

Prevention

When it happens

Trigger: Calling tools.execute(...) with requestOptions.signal already aborted (e.g. an HTTP request timeout fired before the tool call started), or the signal aborting while awaiting file-upload modifiers just before this check.

Common situations: Server frameworks that abort request signals on client disconnect; short AbortSignal.timeout() budgets shared across multiple tool calls; racing user cancellation with tool execution.

Related errors


AI-assisted analysis of ComposioHQ/composio@64b1b85502 (2026-08-28). Data as JSON: /api/errors/34a52723791f21eb. Report an issue: GitHub.