mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-21 05:52:35 +08:00
fix: match hyphenated rate-limit prose in retry heuristics
This commit is contained in:
@@ -226,6 +226,18 @@ describe("responses api terminal frames", () => {
|
||||
expect(result.data.isRetryable).toBe(false)
|
||||
})
|
||||
|
||||
test("retries hyphenated rate-limit prose", () => {
|
||||
const payload = {
|
||||
code: "upstream_error",
|
||||
message: "openai/gpt-5.6-terra-pro is temporarily rate-limited upstream. Please retry shortly.",
|
||||
}
|
||||
const result = MessageV2.fromError(payload, { providerID: ProviderV2.ID.make("openai") })
|
||||
|
||||
expect(MessageV2.APIError.isInstance(result)).toBe(true)
|
||||
if (!MessageV2.APIError.isInstance(result)) throw new Error("expected APIError")
|
||||
expect(result.data.isRetryable).toBe(true)
|
||||
})
|
||||
|
||||
test("ignores response.failed frames without an error payload", () => {
|
||||
const payload = { type: "response.failed", response: { error: null, incomplete_details: null } }
|
||||
const result = MessageV2.fromError(payload, { providerID: ProviderV2.ID.make("openai") })
|
||||
|
||||
Reference in New Issue
Block a user