CherryHQ/cherry-studio · error · Error

Task polling timeout

Error message

Task polling timeout

What it means

Thrown by `DashScopeTransport.pollTaskResult` after exceeding `maxAttempts` (default 120) polls without the task reaching `SUCCEEDED`. The poll interval scales from 3s (first 60s) to 10s, so the default budget is roughly 15–20 minutes. This is a budget exhaustion, not a vendor failure.

Source

Thrown at src/main/ai/provider/custom/dashscope/dashscopeTransport.ts:494

        if (error instanceof DashScopeApiError && isTerminalHttpStatus(error.statusCode)) throw error

        transientRetries++
        if (transientRetries >= maxTransientRetries) {
          throw error instanceof Error ? error : new Error(String(error))
        }
        const elapsedTime = Date.now() - startTime
        const pollDelay = interval ?? (elapsedTime < 60000 ? 3000 : 10000)
        await waitWithSignal(pollDelay, signal)
        continue
      }

      const elapsedTime = Date.now() - startTime
      const pollDelay = interval ?? (elapsedTime < 60000 ? 3000 : 10000)
      await waitWithSignal(pollDelay, signal)
      attempts++
    }

    throw new Error('Task polling timeout')
  }

  private async request<T>(
    path: string,
    method: 'POST' | 'GET',
    body: Record<string, unknown> | undefined,
    options: { timeout?: number; signal?: AbortSignal; extraHeaders?: Record<string, string> }
  ): Promise<T> {
    const timeout = options.timeout ?? DEFAULT_TIMEOUT
    const externalSignal = options.signal
    const controller = new AbortController()
    let externallyAborted = false

    const timeoutId = setTimeout(() => controller.abort(), timeout)
    const onExternalAbort = () => {
      externallyAborted = true
      controller.abort()
    }

View on GitHub (pinned to 726446b54c)

Solutions

  1. Increase `maxAttempts` / `interval` in the poll options to extend the budget for slow models.
  2. Check network connectivity to `dashscope.aliyuncs.com` and retry the generation.
  3. If the task is consistently stuck at PENDING, verify the model is available and the account is not throttled.
Defensive patterns

Strategy: retry

Validate before calling

const POLL_OPTIONS = { maxAttempts: 180, interval: 5000 } // extend budget for slow models

Try / catch

try {
  urls = await transport.poll(taskId, { ...opts, maxAttempts: 180 })
} catch (e) {
  if (e instanceof Error && e.message === 'Task polling timeout') {
    // resubmit or surface a 'generation is taking too long' message
  }
  throw e
}

Prevention

When it happens

Trigger: A DashScope async task that never completes within the polling window: a very slow model, a stuck PENDING/RUNNING task, or repeated transient poll failures consuming the retry budget without progress.

Common situations: Heavy model under load; network latency inflating poll round-trips; a task queued behind many others on the vendor side; repeated 5xx/429 polls eating into transient retries before maxAttempts.

Understand the failure class

Related errors


AI-assisted analysis of CherryHQ/cherry-studio@726446b54c (2026-08-12). Data as JSON: /api/errors/a49ef5bb20ba5370. Report an issue: GitHub.