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:
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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"]),
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user