{"record":{"id":"771b27994f73428e","repo":"paperclipai/paperclip","slug":"unsupported-storage-response-body","errorCode":null,"errorMessage":"Unsupported storage response body.","messagePattern":"Unsupported storage response body\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/commands/worktree.ts","lineNumber":380,"sourceCode":"    transformToWebStream?: () => ReadableStream<Uint8Array>;\n    arrayBuffer?: () => Promise<ArrayBuffer>;\n  };\n  if (typeof candidate.transformToWebStream === \"function\") {\n    const webStream = candidate.transformToWebStream();\n    const reader = webStream.getReader();\n    const chunks: Uint8Array[] = [];\n    while (true) {\n      const { done, value } = await reader.read();\n      if (done) break;\n      if (value) chunks.push(value);\n    }\n    return Buffer.concat(chunks.map((chunk) => Buffer.from(chunk)));\n  }\n  if (typeof candidate.arrayBuffer === \"function\") {\n    return Buffer.from(await candidate.arrayBuffer());\n  }\n\n  throw new Error(\"Unsupported storage response body.\");\n}\n\nfunction normalizeS3Prefix(prefix: string | undefined): string {\n  if (!prefix) return \"\";\n  return prefix.trim().replace(/^\\/+/, \"\").replace(/\\/+$/, \"\");\n}\n\nfunction buildS3ObjectKey(prefix: string, objectKey: string): string {\n  return prefix ? `${prefix}/${objectKey}` : objectKey;\n}\n\nconst dynamicImport = new Function(\"specifier\", \"return import(specifier);\") as (specifier: string) => Promise<any>;\n\nfunction createConfiguredStorageFromPaperclipConfig(config: PaperclipConfig): ConfiguredStorage {\n  if (config.storage.provider === \"local_disk\") {\n    const baseDir = expandHomePrefix(config.storage.localDisk.baseDir);\n    return {\n      async getObject(companyId: string, objectKey: string) {","sourceCodeStart":362,"sourceCodeEnd":398,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/cli/src/commands/worktree.ts#L362-L398","documentation":"Transport-shape guard when reading an S3 response body: the returned body object exposes none of the recognized consumption interfaces (web stream, arrayBuffer, etc.), so the SDK response cannot be converted to a Buffer by any known strategy.","triggerScenarios":"Thrown at cli/src/commands/worktree.ts:347 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry; if it persists, check the storage backend configuration for the instance."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}