fix(skills): correct image generation error format and provider options - #4350
Draft
amelia-letta wants to merge 1 commit into
Draft
amelia-letta wants to merge 1 commit into
amelia-letta wants to merge 1 commit into
Conversation
The image-generation skill claimed 400/500 errors both return {"message":"..."},
but 400 validation errors return a ZodError shape {"issues":[...],"name":"ZodError"}
while 500 errors return {"message":"..."}. Also, size is used by Flux (not just
OpenAI) and Gemini supports an aspect_ratio option, verified against the
imagesContract schema and imagesRouter source in letta-cloud.
Builtin-skill-watch: image-generation@9ead5f0480b2-5493aa96fe388894
This was referenced Sep 10, 2026
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
image-generationStale claims and current owning source
400/500errors both return{ "message": "..." }. In reality,400validation errors return a ZodError shape{"issues":[...],"name":"ZodError"}while500errors return{"message":"..."}. An agent following the skill literally would readresponse.messageon a 400 validation error and getundefined.sizewas annotated "(OpenAI)" but the server also uses it for Flux (parsed into width/height sent to bfl.ai), and Gemini supports anaspect_ratiooption that the skill omitted.Owning source:
letta-ai/letta-cloudlibs/sdk-cloud-api/src/lib/imagesContract.ts(generateImageBodySchema: prompt 1–32000, n int 1–4, input_images max 14, aspect_ratio) andlibs/tmp-cloud-api-router/src/lib/images/imagesRouter.ts(parseSize → Flux width/height, aspect_ratio → Gemini responseFormat, 402 credits_required, 500 message body).Focused validation
POST /v1/images/generations: invalid provider → 400 ZodError listing["openai","gemini","flux"];n=5→ 400 ZodError "must be less than or equal to 4"; missing prompt → 400 ZodError "Required"; valid gemini request → 200 withb64_jsonimage andbilling.credits_chargedbun run check— all 12 checks passedTest plan