test(runtime-fallback): fix OpenAI auto-retry test expectations

- Add timeout_seconds to mock config for auto-retry signal detection

- Add 'usage limit' pattern to quota_exceeded error classification

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-04-08 13:40:40 +09:00
parent 902b2f9f58
commit 2c6a161441
2 changed files with 3 additions and 2 deletions
@@ -131,7 +131,8 @@ export function classifyErrorType(error: unknown): string | undefined {
/billing.?(?:hard.?)?limit/i.test(message) ||
/exhausted\s+your\s+capacity/i.test(message) ||
/out\s+of\s+credits?/i.test(message) ||
/payment.?required/i.test(message)
/payment.?required/i.test(message) ||
/usage\s+limit/i.test(message)
) {
return "quota_exceeded"
}
+1 -1
View File
@@ -518,7 +518,7 @@ describe("runtime-fallback", () => {
test("should trigger fallback on OpenAI auto-retry signal in message.updated", async () => {
const hook = createRuntimeFallbackHook(createMockPluginInput(), {
config: createMockConfig({ notify_on_fallback: false }),
config: createMockConfig({ notify_on_fallback: false, timeout_seconds: 30 }),
pluginConfig: createMockPluginConfigWithCategoryFallback(["anthropic/claude-opus-4-6"]),
})