{"record":{"id":"3d32f2eecf0e7659","repo":"CherryHQ/cherry-studio","slug":"image-transport-returned-a-task-id-but-does-not-im","errorCode":null,"errorMessage":"Image transport returned a task id but does not implement polling","messagePattern":"Image transport returned a task id but does not implement polling","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/main/ai/provider/custom/tasks/imageGenerationJobHandler.ts","lineNumber":177,"sourceCode":"  }\n}\n\nasync function readImageFile(fileId: string): Promise<ImageModelV3File> {\n  const { content, mime } = await application.get('FileManager').read(fileId, { encoding: 'base64' })\n  return { type: 'file', mediaType: mime, data: content }\n}\n\n/**\n * Run the transport's poll loop, cancelling the remote task on job abort.\n * Mirrors the abort handling in `imageGenerationModel.doGenerate`.\n */\nasync function pollUntilDone(\n  transport: ImageGenerationTransport,\n  taskId: string,\n  ctx: JobContext<ImageGenerationJobPayload>\n): Promise<string[]> {\n  if (!transport.poll) {\n    throw new Error('Image transport returned a task id but does not implement polling')\n  }\n  const cancelRemote = transport.cancel ? () => void transport.cancel?.(taskId).catch(() => {}) : undefined\n  if (cancelRemote) {\n    if (ctx.signal.aborted) {\n      cancelRemote()\n      throw createAbortError('Image generation aborted')\n    }\n    ctx.signal.addEventListener('abort', cancelRemote, { once: true })\n  }\n  try {\n    return await transport.poll(taskId, {\n      signal: ctx.signal,\n      onProgress: (progress) => ctx.reportProgress(progress, { stage: 'polling' }),\n      // Carry the descriptor so the poll rebuilds per-task state on a transport\n      // instance that did not run the submit (DashScope's response family).\n      modelDescriptor: ctx.input.modelDescriptor\n    })\n  } finally {","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/CherryHQ/cherry-studio/blob/726446b54cd69ffe51a276638672f6d95ca0768c/src/main/ai/provider/custom/tasks/imageGenerationJobHandler.ts#L159-L195","documentation":"Error \"Image transport returned a task id but does not implement polling\" thrown in CherryHQ/cherry-studio.","triggerScenarios":"A transport's submit() returns a taskId but the transport object does not implement the poll() method needed to follow the async task.","commonSituations":"Indicates a wiring defect: a provider implemented async submit without polling (or the wrong transport was resolved for the model). The job fails fast instead of hanging or dropping the remote task.","solutions":["Implement the polling method on the image transport, or return imageUrls synchronously instead of a task id.","Check that the correct transport class is registered for this provider — a base class lacking pollTask may be in use."],"exampleFix":"Add pollTask(taskId) to the provider's transport class so the job handler can await completion of async tasks.","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"726446b54cd69ffe51a276638672f6d95ca0768c","analyzedAt":"2026-08-12T17:30:37.448Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}