CherryHQ/cherry-studio · error · Error

DashScope API request timeout after ${timeout / 1000}s

Error message

DashScope API request timeout after ${timeout / 1000}s

What it means

Thrown when a single DashScope HTTP request is aborted by its internal `AbortController` timeout (not by an external caller abort). Each request sets a per-call timeout (120s for submit, 10s for poll, `DEFAULT_TIMEOUT` otherwise); when it elapses the fetch is aborted and, because the abort was internal, this timeout error is thrown instead of an `AbortError`.

Source

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

        ...options.extraHeaders
      },
      signal: controller.signal
    }
    if (method === 'POST' && body !== undefined) {
      fetchOptions.body = JSON.stringify(body)
    }

    try {
      const response = await fetch(`${this.baseURL}${path}`, fetchOptions)
      if (!response.ok) {
        const errorText = (await response.text().catch(() => '')).slice(0, 500)
        throw new DashScopeApiError(`DashScope API error: ${response.status} - ${errorText}`, response.status)
      }
      return (await response.json()) as T
    } catch (error) {
      if (error instanceof Error && error.name === 'AbortError') {
        if (externallyAborted) throw createAbortError('DashScope API request aborted')
        throw new Error(`DashScope API request timeout after ${timeout / 1000}s`)
      }
      throw error
    } finally {
      clearTimeout(timeoutId)
      externalSignal?.removeEventListener('abort', onExternalAbort)
    }
  }
}

export function createDashScopeTransport(settings: DashScopeTransportSettings): DashScopeTransport {
  return new DashScopeTransport(settings)
}

export type { DashScopeTransport }

View on GitHub (pinned to 726446b54c)

Solutions

  1. Check network connectivity and latency to the DashScope host.
  2. Retry the request — transient slow responses often succeed on the next attempt.
  3. If consistently slow, review whether a proxy or VPN is adding latency.
Defensive patterns

Strategy: retry

Type guard

const isDashScopeTimeout = (e: unknown): boolean =>
  e instanceof Error && /DashScope API request timeout/.test(e.message)

Try / catch

for (let attempt = 0; attempt < 3; attempt++) {
  try {
    return await transport.submit(input)
  } catch (e) {
    if (e instanceof Error && /request timeout/.test(e.message) && attempt < 2) continue
    throw e
  }
}

Prevention

When it happens

Trigger: A submit or poll HTTP call took longer than its timeout threshold: a slow vendor response, a congested network, or a large image upload stalling.

Common situations: Network latency or packet loss to DashScope; vendor endpoint slow under load; a proxy between the app and the API adding latency.

Understand the failure class

Related errors


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