From 44fb1143707f29b608a0e902db25257fb6310d36 Mon Sep 17 00:00:00 2001 From: MoerAI Date: Wed, 25 Mar 2026 16:58:49 +0900 Subject: [PATCH] fix(runtime-fallback): rename misleading test to match actual behavior The test name claimed it exercised RETRYABLE_ERROR_PATTERNS directly, but classifyErrorType actually matches 'payment required' via the quota_exceeded path first. Rename to 'detects payment required errors as retryable' to accurately describe end-to-end behavior. --- src/hooks/runtime-fallback/error-classifier.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hooks/runtime-fallback/error-classifier.test.ts b/src/hooks/runtime-fallback/error-classifier.test.ts index ba9b70f1a..63e38733e 100644 --- a/src/hooks/runtime-fallback/error-classifier.test.ts +++ b/src/hooks/runtime-fallback/error-classifier.test.ts @@ -250,11 +250,11 @@ describe("quota error detection (fixes #2747)", () => { expect(errorType).toBe("quota_exceeded") }) - test("matches payment required pattern directly via RETRYABLE_ERROR_PATTERNS", () => { - //#given — message has no quota keyword, only "payment required" + test("detects payment required errors as retryable", () => { + //#given const error = { message: "Error 402: payment required for this request" } - //#when — classifyErrorType will NOT match (no quota keyword), so isRetryableError must use RETRYABLE_ERROR_PATTERNS + //#when const errorType = classifyErrorType(error) const retryable = isRetryableError(error, [429, 503])