fix: quota error disambiguation, img2img params, stale model count (#61 #62 #63)#65
Merged
Merged
Conversation
…63) When a subscriber's monthly plan allocation is exhausted and they also have no credit pack balance, the gateway now returns reason=quota_exhausted with quota_resets_at (ISO 8601) instead of the generic insufficient_credits error — telling them when quota resets rather than directing them to buy credits as their only option. Credit-only users (free tier, unsubscribed) still get insufficient_credits. Consumes the reason + quota_resets_at fields added in edge-auth#153. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Error message now reads: "Monthly image quota exhausted. Top off at https://stackbilder.com/img-forge#credits or wait for reset on July 1, 2026." Previous version omitted the URL (leaving users with no actionable next step in terminals that only show the message string) and the year (ambiguous for December users). Also applied same "Top off at <url>" phrasing to insufficient_credits. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Error now reads: "Monthly image quota exhausted (N images/mo). Add credits from $9.99 at https://stackbilder.com/img-forge#credits — or wait for reset on [date]." quota_limit threads from edge-auth QuotaResult → QuotaCheckResult → message. Price anchor ($9.99) is the smallest credit pack entry point — gives users a cost signal before they navigate to the purchase page. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
… img2img params image_list_models: description no longer hardcodes "13 models / 11 CF models" — live model count comes from img-forge; gateway description was stale after #61. image_generate: adds input_image, mask_image, input_strength, strength to inputSchema so RunwayML img2img/inpainting cf_model values are actually callable. cf_model description now calls out that RunwayML variants require input_image. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
TIER_ALLOWED_QUALITY had Gemini blocked with a "re-add when capacity confirmed" comment. Capacity is confirmed; tool descriptions already promise ultra_plus to Pro plan users. Aligns code with contract. Fixes failing test: allows pro-tier user who passes model=gemini-3-pro-image-preview Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
quota_exhaustedfrominsufficient_creditsinimage_generateerror responses. Subscribers now see their reset date instead of a buy-credits prompt when their monthly allocation runs out. Includesquota_limit+ price anchor in the message.image_list_modelsdescription no longer hardcodes model count. Live count comes from img-forge; the gateway description was drifting after each img-forge deploy.image_generateschema now exposesinput_image,mask_image,input_strength, andstrengthfor RunwayML img2img/inpaintingcf_modelvalues.cf_modeldescription explicitly calls out that RunwayML variants requireinput_image.Not in this PR
IMAGE_CREDIT_COSTtable is aligned).earliest-joinedheuristic). Cross-referenced there with the specific MCP symptom.Test plan
tools/list→image_generateschema includesinput_image,mask_image,input_strength,strengthtools/list→image_list_modelsdescription has no hardcoded countquota_exhausted, message includes reset date + quota_limitinsufficient_credits, message includes purchase URLimage_generatewith RunwayMLcf_model+input_imagereaches img-forge backend unchanged🤖 Generated with Claude Code