From f2fac9bc0b13cdfe2b97f79279d63c39662da953 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Wed, 8 Apr 2026 13:14:54 +0900 Subject: [PATCH] test(runtime-fallback): update tests for quota STOP classification Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- src/hooks/runtime-fallback/index.test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/hooks/runtime-fallback/index.test.ts b/src/hooks/runtime-fallback/index.test.ts index f546716a8..f055cde3d 100644 --- a/src/hooks/runtime-fallback/index.test.ts +++ b/src/hooks/runtime-fallback/index.test.ts @@ -2060,7 +2060,7 @@ describe("runtime-fallback", () => { expect(retriedModels).toContain("openai/gpt-5.3-codex") }) - test("triggers fallback when message contains type:error parts (e.g. Minimax insufficient balance)", async () => { + test("does NOT trigger fallback for quota exhaustion in error parts without auto-retry signal (STOP classification)", async () => { const retriedModels: string[] = [] const hook = createRuntimeFallbackHook( @@ -2108,7 +2108,10 @@ describe("runtime-fallback", () => { }, }) - expect(retriedModels).toContain("openai/gpt-5.4") + expect(retriedModels).toHaveLength(0) + + const skipLog = logCalls.find((c) => c.msg.includes("message.updated error not retryable")) + expect(skipLog).toBeDefined() }) test("triggers fallback when message has mixed text and error parts", async () => {