fix(model-core): retry OpenAI usage_limit_reached fallbacks

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-05-25 17:09:19 +09:00
parent 6343feb608
commit 767f5a6148
3 changed files with 22 additions and 3 deletions
@@ -0,0 +1,18 @@
import { describe, expect, test } from "bun:test"
import { shouldRetryError } from "./model-error-classifier"
describe("model-error-classifier OpenAI usage_limit_reached", () => {
test("treats OpenAI usage_limit_reached response bodies as retryable provider exhaustion", () => {
//#given
const error = {
name: "AI_APICallError",
message: '{"error":{"type":"usage_limit_reached","message":"The usage limit has been reached"}}',
}
//#when
const result = shouldRetryError(error)
//#then
expect(result).toBe(true)
})
})