@myagentroam/agent 0.10.34 → 0.10.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -49,7 +49,11 @@ export async function fetchModelResponse(url, init, signal, attempts = MAX_MODEL
|
|
|
49
49
|
if (!isRetryableModelTransportError(error))
|
|
50
50
|
throw error;
|
|
51
51
|
if (attempt + 1 >= attempts)
|
|
52
|
-
throw new MarAgentError('
|
|
52
|
+
throw new MarAgentError(hasErrorCode(error, 'ETIMEDOUT') ||
|
|
53
|
+
hasErrorCode(error, 'UND_ERR_CONNECT_TIMEOUT') ||
|
|
54
|
+
hasErrorCode(error, 'UND_ERR_HEADERS_TIMEOUT')
|
|
55
|
+
? 'MAR_AGENT_MODEL_TIMEOUT'
|
|
56
|
+
: 'MAR_AGENT_MODEL_CONNECTION_FAILED', attempts === 1
|
|
53
57
|
? 'Model transport request failed.'
|
|
54
58
|
: 'Model transport request failed after retries.', { retryable: true, details: { reason: 'MODEL_TRANSPORT_FAILURE' }, cause: error });
|
|
55
59
|
await waitForModelRetry(null, attempt, signal);
|