mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 12:40:43 +00:00
fix(pi-embedded-helpers): classify exact unknown-no-details error as unknown
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -684,6 +684,12 @@ describe("classifyFailoverReason", () => {
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
it("classifies OpenAI Responses unknown-no-details message as unknown", () => {
|
||||
const message = "Unknown error (no error details in response)";
|
||||
expect(classifyFailoverReason(message)).toBe("unknown");
|
||||
expect(isFailoverErrorMessage(message)).toBe(true);
|
||||
});
|
||||
|
||||
it("classifies provider-scoped generic upstream messages", () => {
|
||||
expect(classifyFailoverReason("An unknown error occurred", { provider: "anthropic" })).toBe(
|
||||
"timeout",
|
||||
|
||||
@@ -668,6 +668,10 @@ function isOpenRouterKeyLimitExceededError(raw: string, provider?: string): bool
|
||||
);
|
||||
}
|
||||
|
||||
function isExactUnknownNoDetailsError(raw: string): boolean {
|
||||
return normalizeOptionalLowercaseString(raw)?.trim() === "unknown error (no error details in response)";
|
||||
}
|
||||
|
||||
function classifyFailoverClassificationFromMessage(
|
||||
raw: string,
|
||||
provider?: string,
|
||||
@@ -737,6 +741,9 @@ function classifyFailoverClassificationFromMessage(
|
||||
if (isCloudCodeAssistFormatError(raw)) {
|
||||
return toReasonClassification("format");
|
||||
}
|
||||
if (isExactUnknownNoDetailsError(raw)) {
|
||||
return toReasonClassification("unknown");
|
||||
}
|
||||
if (isTimeoutErrorMessage(raw)) {
|
||||
return toReasonClassification("timeout");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user