feat: show specific retry messages for known LLM provider errors (#953)
This commit is contained in:
@@ -433,6 +433,25 @@ export function formatErrorDetails(
|
||||
return String(e);
|
||||
}
|
||||
|
||||
const DEFAULT_RETRY_MESSAGE =
|
||||
"Unexpected downstream LLM API error, retrying...";
|
||||
|
||||
/**
|
||||
* Return a user-facing status message for a retriable LLM API error.
|
||||
* Matches known provider error patterns from the run's error detail and
|
||||
* returns a specific message; falls back to a generic one otherwise.
|
||||
*/
|
||||
export function getRetryStatusMessage(
|
||||
errorDetail: string | null | undefined,
|
||||
): string {
|
||||
if (!errorDetail) return DEFAULT_RETRY_MESSAGE;
|
||||
|
||||
if (errorDetail.includes("Anthropic API is overloaded"))
|
||||
return "Anthropic API is overloaded, retrying...";
|
||||
|
||||
return DEFAULT_RETRY_MESSAGE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a terminal hyperlink to the agent with run ID displayed
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user