Repository navigation
Description
Context
brain image only accepts --format png|jpeg|webp (FORMATS, packages/module-images/src/cli.ts:35; ImageRequest.format, packages/module-images/src/types.ts:25). GPT Image 2.6 can return an animated GIF: output_format: "gif" on POST /v1/images/generations and /v1/images/edits, with frame_count 2–16 (default 9) and frame_duration_ms 20–2000 (default 200, rounded to 10 ms). Sources are in #3781 and were checked 2026-11-09. The API reference says GIF needs "GIF preview access for the model". GIF output has no streaming, partial images, custom compression or masks. The guide does not say whether background: "transparent" applies to GIF; transparency is documented for png/webp only.
Blocked by #3782
Scope
- Add
--format gif, served only by the 2.6 pair (a capability flag on the model, used by routing). - Add
--frames <2-16>and--frame-duration <ms 20-2000>, valid only with--format gif. Validate them before routing and send them asframe_countandframe_duration_ms. When omitted, send nothing and let the API apply its documented defaults (9 frames, 200 ms). - Refuse before any provider call: GIF with
--mask, with--transparent(undocumented for GIF), on Gemini or the 2.5 models, and frame flags without--format gif. - Write the file as
.gifwith mimeimage/gif. The result reports the actual format. - An OpenAI refusal for missing GIF preview access is shown with a hint that names the access requirement and is not marked retryable.
- Dry-run cost for GIF stays unknown (
null). The calculator does not document per-frame token counts. - Update help, README, skill and changeset.
Out of scope
Streaming. Converting GIF to video. Inspecting or validating frames after download. Raising the frame limit above 16 unless the API reference changes. GIF reference-image input.
Acceptance criteria
- Offline stubs show
brain image "x" --format gif --frames 12 --frame-duration 150sendsoutput_format:"gif",frame_count:12andframe_duration_ms:150to the default 2.6 model, plus Epic: image generation runs on GPT Image 2.6 and uses its complexity, GIF, SVG and markup features #3781's quality and complexity defaults. The bytes are written to a.gifpath. The multipart edit with--refcarries the same fields. -
--frames 1,--frames 17,--frame-duration 10,--frame-duration 2001, and frame flags without--format gifrefuse with zero fetch calls and name the valid range. - GIF with
--mask,--transparent,--provider geminior--model gpt-image-2.5-sunburstrefuses with zero fetch calls and an actionable reason. - A dry run reports
estimatedCostUsd: nullfor GIF. - Failing-first receipts and a restored mutation of the frame-range guard.
Verification
bun run test packages/module-images
bun run typecheck
bun run lint
bun run check:pr --base origin/mainKeyless and offline only.
Contract impact
The --json envelopes are unchanged; output simply ends in .gif. The new flags are additive CLI behaviour, shipped as a minor changeset for @schlessera/brain-module-images.
Activity
schlessera commentedon Nov 10, 2026
Unblocked: #3782 is closed, so
scripts/sync-project.tsis removing theblockedlabel.schlessera commentedon Nov 10, 2026
Claimed for implementation. Claim token:
claim-1dcbef18. Branch:feat/3783-image-gif.none blocking (collision report checked before claim)
schlessera commentedon Nov 10, 2026
Status: implemented in #3868 (head
18c3bad102f54db11dbdc9282099e06216466018, draft, milestone 0.45.0); not merged yet.Every acceptance criterion is covered by offline tests in
packages/module-images(194 pass, 0 fail). Typecheck, lint andcheck:prpass. The failing-first receipt and the frame-range mutation are in the PR body.Blocker: main has been red since
b77987afb(#3884, claimed by another orchestrator). Proof for non-fix PRs is paused untilbun scripts/integrate.ts main-status --jsonreports green.To resume, once main is green:
origin/mainintofeat/3783-image-gifand push. The PR's own files need no change unless main touchedpackages/module-images/.bun scripts/integrate.ts confirm 3868 --issues schlessera/brain-kit#3783(exit 2 with"merged":truemeans it merged).Releasing my claim so the issue is not held while main is red.
schlessera commentedon Nov 10, 2026
Claimed for implementation. Claim token:
claim-55b59d95. Branch:feat/3783-image-gif.resuming PR 3868 after main returned green
feat(images): animated GIFs from GPT Image 2.6 with --format gif, --f…
schlessera commentedon Nov 11, 2026
Delivered by #3868, squashed onto main as
a875fa5f910c68df7dde92546ef09df0ea204ec4(milestone 0.45.0). Every acceptance criterion is covered by offline tests inpackages/module-images; the failing-first receipt and the frame-range mutation are in the PR body. The hint for missing GIF preview access matches inferred wording, since no live call was made.feat(images): static SVG from GPT Image 2.6 with --format svg, refusi…