classifyAgentProxyRetryable
判断 IM 智能体代理失败是否可自动重试。
函数签名
typescript
interface ClassifyAgentProxyRetryableDeps {
getHttpStatus?: (error: unknown) => number | undefined
}
function classifyAgentProxyRetryable(
e: unknown,
deps?: ClassifyAgentProxyRetryableDeps,
): boolean工作原理
- HTTP 400/401/403/404 → 不重试。
- 网络类错误(
ECONNRESET、ETIMEDOUT等)或含超时/503 文案 → 可重试。 - API 侧注入
getHttpStatus以识别 NestHttpException。