e4e9eb0928becfa4e48484dde85ef5032671d582
2
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
436d507f0e |
usage: a ChatGPT card's image row tells the window its replies' headers say, not a 15-minute guess (#6412, Green14964 on X)
ChatGPT's images API answers every drawing, a 200 too, with the image allowance it counted: x-codex-active-limit: imagegen_premium and the window in x-codex-primary-* (window-minutes 1440, reset-at), as the reporter captured on a Pro account; Codex 0.160.1 also reads it from a family named for the limit (x-imagegen-premium-primary-*, parse_all_rate_limits). magpie read none of it on the image path: the row said "Unknown" until a refusal, and a refusal whose body names no resets_at rested the image model for quotaRest's 15 minutes, so the card said "2 minutes" of a 24-hour window. - gateway/codex_image_limits.go: codexImageHeaderLimit reads the image window from the limit's own family or, when x-codex-active-limit names an image limit, from x-codex-*; heardCodexImage keeps it per account (in memory), handed to provider.ImageHeard. - Both drawing routes hear it: magpie's own (sendWith in draw.go) and Codex's relayed /images/generations and /images/edits (codex_backend.go). - codexHeaderLimits tells no chat window when the active limit is an image one, so the 1440-minute window never lands on the 5-hour or weekly row. - restDrawer: a 429 with the heard window at 100% counts as the quota (ChatGPT's "image limit reached" read as a rate limit), and with no resets_at in the body it rests until the heard reset, capped at longestQuota. - provider.WithImageLane: the row says Available (or Used up at 100%) with that reset; a rest still says Used up. "Available" translated (zh, zh-TW, ja, de). - docs/subsystems/providers-accounts.md updated. Run (mote): at base |
||
|
|
0706d7a35a |
usage: a ChatGPT card has an image row: used up until the refusal's reset, else unknown (#6160, hqqqqqqqh on X)
ChatGPT's image generation has a quota apart from the 5-hour and weekly windows. Neither /wham/usage (additional_rate_limits is null) nor the reply headers (x-codex-primary-*, x-codex-secondary-*) tell it, so no remaining count exists to show. Each Codex account's card (Usage page, magpie quota --json, /v1/magpie/quotas, /v1/magpie/quotas/cards) now has an "Image generation" row (provider.WithImageLane, Lane "images", Text and Aside so routing, holds, history, tray and statusline never see it): "Used up" with the reset time while the image model rests on that account after a refusal (the #2244 drawing-lane rest, whose time is the refusal's resets_at), and "Unknown" otherwise. Never a share or a count. Shown in en, zh, zh-TW, ja, de. app.js: a Text row's display now goes through t(), a same-length change, as the core script budget has 1 byte of room. Run (on mote): go test -count=1 -run 'TestWithImageLane|TestCodexImageRow' ./internal/provider ./internal/gateway ok; codex-image-row.test.cjs in chromium and webkit at 900 and 390px in all five languages ok; TestCoreScriptBudget ok; go vet darwin, windows, linux nogui on provider and gateway ok; gofmt clean; 158 GUI files matching i18n/quota/usage/balance names in both engines (result in the follow-up). Broken by hand: the GUI test is red with app.js's display line put back to the old form; the Go row tests are red with imageRestOf returning false. Not tried: a real ChatGPT account hitting its image quota (the row is driven by a faked refusal's rest); the generated-image count the issue also asks for is not built. |