Skip to content

fix(skills): correct image generation error format and provider options - #4350

Draft
amelia-letta wants to merge 1 commit into
mainfrom
amelia/skill-watch-image-generation
Draft

amelia-letta wants to merge 1 commit into
mainfrom
amelia/skill-watch-image-generation

Conversation

@amelia-letta

Copy link
Copy Markdown
Collaborator

Summary

  • Builtin-skill-watch: image-generation@9ead5f0480b2-5493aa96fe388894
  • Selected skill: image-generation

Stale claims and current owning source

  1. The skill claimed 400/500 errors both return { "message": "..." }. In reality, 400 validation errors return a ZodError shape {"issues":[...],"name":"ZodError"} while 500 errors return {"message":"..."}. An agent following the skill literally would read response.message on a 400 validation error and get undefined.
  2. size was annotated "(OpenAI)" but the server also uses it for Flux (parsed into width/height sent to bfl.ai), and Gemini supports an aspect_ratio option that the skill omitted.

Owning source: letta-ai/letta-cloud libs/sdk-cloud-api/src/lib/imagesContract.ts (generateImageBodySchema: prompt 1–32000, n int 1–4, input_images max 14, aspect_ratio) and libs/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

  • Live probes of 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 with b64_json image and billing.credits_charged
  • Source inspection of imagesContract.ts and imagesRouter.ts in letta-cloud
  • bun run check — all 12 checks passed

Test plan

  • Review that the error format description matches actual API behavior
  • Verify size/aspect_ratio provider annotations match the contract

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant