mirror of
https://github.com/openai/codex.git
synced 2026-11-16 22:00:36 +00:00
Preserve image generation failure metadata for premium usage limits (#57275)
## Why Image generation usage-limit errors with the `imagegen_premium` limit ID were not recognized as structured `UsageLimitExceeded` failures. ## What changed Recognize `imagegen_premium` alongside `image_gen`, preserving the limit ID and available reset time in image generation failure metadata. ## Testing Extend app-server coverage to verify premium limit metadata and reset-time fallback in completion events, thread reads, and resumed threads. Add unit coverage for missing exhausted-window reset times and unrelated or absent limit IDs. GitOrigin-RevId: 8cf991776403ddce1f45d9780b8040982fd0fcfe
This commit is contained in:
@@ -323,7 +323,7 @@ fn usage_limit_failure(error: &CodexErr) -> Option<ImageGenerationFailure> {
|
||||
};
|
||||
let rate_limits = usage_limit.rate_limits.as_deref()?;
|
||||
let limit_id = rate_limits.limit_id.as_deref()?;
|
||||
if limit_id != "image_gen" {
|
||||
if !matches!(limit_id, "image_gen" | "imagegen_premium") {
|
||||
return None;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user