{"record":{"id":"41a1732bcc93538a","repo":"ComposioHQ/composio","slug":"failed-to-parse-file-delete-response","errorCode":null,"errorMessage":"Failed to parse file delete response","messagePattern":"Failed to parse file delete response","errorType":"validation","errorClass":"ValidationError","httpStatus":null,"severity":"error","filePath":"ts/packages/core/src/models/ToolRouterSessionFileMount.ts","lineNumber":396,"sourceCode":"  ): 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;\n  }\n}\n","sourceCodeStart":378,"sourceCodeEnd":403,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/core/src/models/ToolRouterSessionFileMount.ts#L378-L403","documentation":"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.","triggerScenarios":"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.","commonSituations":"Version skew between SDK and API, or error payloads delivered with success status codes.","solutions":["Upgrade @composio/core so response schemas match the current API","Inspect error.cause (ZodError) to see the mismatched fields and report if the SDK is current","Verify via the Composio dashboard whether the file was actually deleted despite the parse failure"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"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; }","preventionTips":["Keep SDK versions aligned with the API","Treat parse failures as ambiguous outcomes and verify server state"],"tags":["validation","zod","api-contract","delete","file-mount"],"backgroundTag":"schema-validation-failed","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}