feat: show specific retry messages for known LLM provider errors (#953)

This commit is contained in:
jnjpng
2026-02-13 12:31:23 -08:00
committed by GitHub
parent a8e232d4ec
commit 40c508fe8c
2 changed files with 21 additions and 3 deletions

View File

@@ -178,6 +178,7 @@ import {
import { setErrorContext } from "./helpers/errorContext";
import {
formatErrorDetails,
getRetryStatusMessage,
isEncryptedContentError,
} from "./helpers/errorFormatter";
import { formatCompact } from "./helpers/format";
@@ -4365,9 +4366,7 @@ export default function App({
// Show subtle grey status message
const statusId = uid("status");
const statusLines = [
"Unexpected downstream LLM API error, retrying...",
];
const statusLines = [getRetryStatusMessage(detailFromRun)];
buffersRef.current.byId.set(statusId, {
kind: "status",
id: statusId,

View File

@@ -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
*/