CherryHQ/cherry-studio · error · Error
Task polling timeout
Error message
Task polling timeout
What it means
Thrown by `ModelscopeTransport.pollTaskResult` after exceeding `maxAttempts` (default 120) polls without the task reaching `SUCCEED`. The poll interval scales from 3s (first 60s) to 10s, giving a default budget of roughly 15–20 minutes. This is budget exhaustion, not a vendor-side failure.
Source
Thrown at src/main/ai/provider/custom/modelscope/modelscopeTransport.ts:187
}
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
- Increase `maxAttempts` / `interval` in the poll options to extend the budget for slow models.
- Check network connectivity to `api-inference.modelscope.cn` and retry.
- If tasks are consistently stuck at PENDING, verify the model is available and the account is not rate-limited.
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
- Size maxAttempts/interval to the slowest supported model
- Treat timeout as retriable — resubmit rather than hard-failing
- Monitor network latency to api-inference.modelscope.cn
When it happens
Trigger: A ModelScope async image task that never completes within the polling window: a slow model under load, a stuck PENDING/RUNNING task, or repeated transient poll failures consuming retries without progress.
Common situations: Heavy model under vendor load; network latency inflating poll round-trips; free-tier queuing behind other tasks; repeated 5xx/429 polls using up transient retries.
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
Related errors
- Task polling timeout
- result.message || 'Task failed'
- Feishu app registration timed out
- DashScope task ${status.toLowerCase()}
- ModelScope API request timeout after ${timeout / 1000}s
AI-assisted analysis of CherryHQ/cherry-studio@726446b54c (2026-08-12).
Data as JSON: /api/errors/6621f87aed18bd5c.
Report an issue: GitHub.