ComposioHQ/composio · error · ValidationError

Failed to parse file delete response

Error message

Failed to parse file delete response

What it means

After the delete API call succeeds at the HTTP level, the SDK validates the response body against FileDeleteResponseSchema. A ValidationError is thrown if the server returns an unexpected shape, indicating an API/SDK contract mismatch rather than caller error.

Source

Thrown at ts/packages/core/src/models/ToolRouterSessionFileMount.ts:396

  ): Promise<FileDeleteResponse> {
    const deleteOptions = ToolRouterSessionFilesMountDeleteOptionsSchema.safeParse(options ?? {});

    if (!deleteOptions.success) {
      throw new ValidationError('Failed to parse tool router session files mount delete options', {
        cause: deleteOptions.error,
      });
    }

    const deleteResponse = await this.client.toolRouter.session.files.delete(
      deleteOptions.data.mountId,
      {
        session_id: this.sessionId,
        mount_relative_path: remotePath,
      }
    );
    const fileDeleteResponse = FileDeleteResponseSchema.safeParse(deleteResponse);
    if (!fileDeleteResponse.success) {
      throw new ValidationError('Failed to parse file delete response', {
        cause: fileDeleteResponse.error,
      });
    }
    return fileDeleteResponse.data;
  }
}

View on GitHub (pinned to 64b1b85502)

Solutions

  1. Upgrade @composio/core so response schemas match the current API
  2. Inspect error.cause (ZodError) to see the mismatched fields and report if the SDK is current
  3. Verify via the Composio dashboard whether the file was actually deleted despite the parse failure
Defensive patterns

Strategy: try-catch

Try / catch

try { const res = await mount.delete(path, opts); } catch (e) { if (e instanceof ValidationError && /file delete response/.test(e.message)) { /* verify state server-side */ } throw e; }

Prevention

When it happens

Trigger: delete() completes but the response body does not conform to FileDeleteResponseSchema — e.g. backend changed its delete response format while the SDK pin is older.

Common situations: Version skew between SDK and API, or error payloads delivered with success status codes.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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