fix(images): two aliases and the default pointed at models the gateway does not serve - #15
Merged
Merged
Conversation
…y does not serve `--model flux` resolved to black-forest/flux-1.1-pro, which is not in the gateway catalog at all. `--model dalle` resolved to openai/dall-e-3, which is available:false since it was delisted upstream. Both failed the call rather than degrading. Worse, dall-e-3 was also the DEFAULT: any image request that did not name a model went to a delisted one. That is every /imagegen call from the skill. flux is dropped, along with its pricing entry — the gateway never served it. The dall-e-3 NAMES stay as aliases so existing scripts keep working, but they now redirect to gpt-image-2. Default is nano-banana. Also adds aliases for four live models the proxy could already reach but had no shorthand for, including cogview — which the imagegen skill was already telling agents to use. src/image-aliases.test.ts pins the invariant: every alias target must be priced here, because a model this proxy cannot charge for is one it does not really support. Writing it caught the same bug in my own fix — I had aliased gpt-image-2 and seedream-5-pro before adding their prices. Prices mirrored from the gateway catalog. The test cannot catch "priced but retired upstream"; availability lives in the catalog, not here, and blockrun's own model tests cover that side.
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.
Found while checking the one number I had said I could not verify — the imagegen skill's "5 models". The count was right. The models were not.
Broken paths
--model fluxblack-forest/flux-1.1-pro--model dalleopenai/dall-e-3available: false— delisted upstreamopenai/dall-e-3That last one is the serious one: every image request that does not name a model went to a delisted model. That includes every
/imagegencall the skill generates.Fix
fluxdropped, with its pricing entry — the gateway never served itdall-e-3/dalle3/dallestay as alias keys so existing scripts keep working, redirected togpt-image-2google/nano-bananacogview— which the imagegen skill was already telling agents to useThe test caught the same bug in my own fix
src/image-aliases.test.tspins the invariant: every alias target must be priced here, because a model this proxy cannot charge for is one it does not really support.On first run it failed — I had aliased
gpt-image-2andseedream-5-probefore adding their prices. Prices then mirrored from the gateway catalog (pricePerImage/ per-size).It also asserts the default is priced, and that
dall-e-3never appears as a target again.What it deliberately cannot catch
"Priced but retired upstream" — availability lives in the gateway catalog, not in this repo. blockrun's own model tests cover that side. Stated in the test so the next reader knows the boundary.
Verification
tscclean · prettier clean · 511 tests pass