Skip to content

Commit c647676

Browse files
committed
fix(vanta): remove the MIME Type field whose value was always discarded
The block rendered an advanced MIME Type input and forwarded it as the tool's mimeType, but the upload path never reads it: file-input.ts sets `resolved.contentType || userFile.type || input.mimeType || …`, and every return path of downloadServableFileFromStorage yields a non-empty content type — a literal, getMimeTypeFromExtension's GENERIC_MIME_TYPE fallback, or resolveServableDocBytes' constants and getContentType fallback. The placeholder claimed it was 'used when the file has no type of its own', which never happens. Removes the subBlock, its mapper write and its inputs entry, and marks the tool param hidden so it is no longer advertised to the model on a path where it cannot take effect. The param itself stays, because the base64 branch still reads it. Letting a typed value win instead was rejected: for a compiled artifact the storage-resolved type is the only one matching the bytes actually sent, so an override would break the case the resolver exists to fix.
1 parent 75f6e15 commit c647676

4 files changed

Lines changed: 3 additions & 17 deletions

File tree

apps/docs/content/docs/en/integrations/vanta.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,6 @@ Upload an evidence file to a Vanta document. Requires credentials with the vanta
331331
| `documentId` | string | Yes | Unique ID of the document to attach the file to |
332332
| `file` | file | No | The evidence file to upload |
333333
| `fileName` | string | No | Optional file name override |
334-
| `mimeType` | string | No | MIME type of the file \(e.g., application/pdf\). Used only for base64 uploads; ignored for a file from the File input, whose content type is always resolved from storage. |
335334
| `description` | string | No | Description of the uploaded evidence \(e.g., "Q3 access review evidence"\) |
336335
| `effectiveAtDate` | string | No | ISO 8601 date indicating when the document is effective from |
337336

apps/sim/blocks/blocks/vanta.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -286,14 +286,6 @@ export const VantaBlock: BlockConfig<ToolResponse> = {
286286
condition: { field: 'operation', value: 'upload_document_file' },
287287
mode: 'advanced',
288288
},
289-
{
290-
id: 'uploadMimeType',
291-
title: 'MIME Type',
292-
type: 'short-input',
293-
placeholder: 'e.g., application/pdf (used when the file has no type of its own)',
294-
condition: { field: 'operation', value: 'upload_document_file' },
295-
mode: 'advanced',
296-
},
297289
{
298290
id: 'uploadDescription',
299291
title: 'Description',
@@ -930,7 +922,6 @@ export const VantaBlock: BlockConfig<ToolResponse> = {
930922
const normalizedFile = normalizeFileInput(rest.file, { single: true })
931923
if (normalizedFile) result.file = normalizedFile
932924
result.fileName = optionalString(rest.uploadFileName)
933-
result.mimeType = optionalString(rest.uploadMimeType)
934925
result.description = optionalString(rest.uploadDescription)
935926
result.effectiveAtDate = optionalString(rest.effectiveAtDate)
936927
break
@@ -993,10 +984,6 @@ export const VantaBlock: BlockConfig<ToolResponse> = {
993984
uploadedFileId: { type: 'string', description: 'Uploaded file ID' },
994985
file: { type: 'json', description: 'Evidence file to upload' },
995986
uploadFileName: { type: 'string', description: 'Optional file name override' },
996-
uploadMimeType: {
997-
type: 'string',
998-
description: 'MIME type override used when the uploaded content has no type of its own',
999-
},
1000987
uploadDescription: { type: 'string', description: 'Description of the uploaded evidence' },
1001988
effectiveAtDate: { type: 'string', description: 'Effective date of the document (ISO 8601)' },
1002989
frameworkMatchesAny: { type: 'string', description: 'Comma-separated framework ID filters' },

apps/sim/tools/generated/tool-metadata.ts

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

apps/sim/tools/vanta/upload_document_file.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ export const vantaUploadDocumentFileTool: InternalToolConfig<
6262
mimeType: {
6363
type: 'string',
6464
required: false,
65-
visibility: 'user-or-llm',
65+
visibility: 'hidden',
6666
description:
67-
'MIME type of the file (e.g., application/pdf). Used only for base64 uploads; ignored for a file from the File input, whose content type is always resolved from storage.',
67+
'MIME type of the file (e.g., application/pdf). Applies only to the base64 upload path; a file from the File input always sends the content type resolved from storage.',
6868
},
6969
description: {
7070
type: 'string',

0 commit comments

Comments
 (0)