fix(runtime-fallback): match Volcano Engine 'exceeded the usage quota' errors
Volcano Engine sends quota exceeded errors with the words in reverse order: 'You have exceeded the 5-hour usage quota'. The existing patterns required 'quota' to precede 'exceeded', so they never matched. - Add /exceeded.*quota/i and /usage.?quota/i to RETRYABLE_ERROR_PATTERNS - Add exceeded.*quota and usage\s*quota to AUTO_RETRY_PATTERNS - Add regression tests for both detection paths Fixes: runtime-fallback not triggering on Volcano Engine quota errors
This commit is contained in:
@@ -56,4 +56,19 @@ describe("runtime-fallback quota error regressions", () => {
|
||||
// quota errors trigger fallback to next configured model
|
||||
expect(retryable).toBe(true)
|
||||
})
|
||||
|
||||
test("classifies Volcano Engine 'exceeded the usage quota' as retryable", () => {
|
||||
//#given
|
||||
const error = {
|
||||
name: "SessionRetry",
|
||||
message: "You have exceeded the 5-hour usage quota. It will reset at 2026-05-11 01:20:12 +0800 CST. We recommend using a different model.",
|
||||
}
|
||||
|
||||
//#when
|
||||
const retryable = isRetryableError(error, [429, 500, 502, 503, 504])
|
||||
|
||||
//#then
|
||||
// Volcano Engine quota errors trigger fallback to the next model
|
||||
expect(retryable).toBe(true)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user