{"record":{"id":"054022e6c97d2d4b","repo":"ComposioHQ/composio","slug":"failed-to-parse-tool-router-session-files-mount-de","errorCode":null,"errorMessage":"Failed to parse tool router session files mount delete options","messagePattern":"Failed to parse tool router session files mount delete options","errorType":"validation","errorClass":"ValidationError","httpStatus":null,"severity":"error","filePath":"ts/packages/core/src/models/ToolRouterSessionFileMount.ts","lineNumber":382,"sourceCode":"   *\n   * @example\n   * ```typescript\n   * // Delete from a custom mount\n   * await session.experimental.files.delete('/old-backup', {\n   *   mountId: 'custom-mount',\n   * });\n   * ```\n   *\n   * @warning This operation is destructive. Deleted files cannot be recovered.\n   */\n  async delete(\n    remotePath: string,\n    options?: ToolRouterSessionFilesMountDeleteOptions\n  ): Promise<FileDeleteResponse> {\n    const deleteOptions = ToolRouterSessionFilesMountDeleteOptionsSchema.safeParse(options ?? {});\n\n    if (!deleteOptions.success) {\n      throw new ValidationError('Failed to parse tool router session files mount delete options', {\n        cause: deleteOptions.error,\n      });\n    }\n\n    const deleteResponse = await this.client.toolRouter.session.files.delete(\n      deleteOptions.data.mountId,\n      {\n        session_id: this.sessionId,\n        mount_relative_path: remotePath,\n      }\n    );\n    const fileDeleteResponse = FileDeleteResponseSchema.safeParse(deleteResponse);\n    if (!fileDeleteResponse.success) {\n      throw new ValidationError('Failed to parse file delete response', {\n        cause: fileDeleteResponse.error,\n      });\n    }\n    return fileDeleteResponse.data;","sourceCodeStart":364,"sourceCodeEnd":400,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/core/src/models/ToolRouterSessionFileMount.ts#L364-L400","documentation":"The delete() method validates its options with ToolRouterSessionFilesMountDeleteOptionsSchema before calling the API. If the options object fails validation (typically a missing or invalid mountId), a ValidationError wrapping the Zod issues is thrown before any request is made.","triggerScenarios":"Calling mount.delete(remotePath, options) where mountId is absent, undefined, or not a valid string.","commonSituations":"Calling delete right after upload without threading the mountId through, or a typo'd options key silently producing undefined.","solutions":["Pass a valid mountId string in the delete options","Reuse the same validated options object used for upload/download on the same mount","Check error.cause issues for the precise failing field"],"exampleFix":"// before\nawait mount.delete('/data/file.csv', {});\n// after\nawait mount.delete('/data/file.csv', { mountId });","handlingStrategy":"validation","validationCode":"if (typeof opts?.mountId !== 'string' || !opts.mountId) throw new Error('mountId required');\nawait mount.delete(path, opts);","typeGuard":"const isDeleteOpts = (o: unknown): o is { mountId: string } =>\n  typeof o === 'object' && o !== null && typeof (o as any).mountId === 'string';","tryCatchPattern":"try { await mount.delete(path, opts); } catch (e) { if (e instanceof ValidationError) console.error(e.cause?.issues); throw e; }","preventionTips":["Thread the same mountId used for upload into delete"],"tags":["validation","zod","delete","file-mount","typescript"],"backgroundTag":"schema-validation-failed","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}