Skip to content

modules: default image generation to GPT Image 2.6 at max quality and high complexity, with --complexity #3782

Closed

Description

@schlessera

Context

brain image defaults to gpt-image-2.5-sunburst (POLICY_PREFERENCE, packages/module-images/src/evidence.ts:56) and lists only the 2.5 pair (MODELS, packages/module-images/src/providers/openai.ts:67-80). When --quality is absent it sends no quality (packages/module-images/src/providers/openai.ts:263-271), so the API resolves auto per image, and a dry run cannot price it (packages/module-images/src/cli.ts:313-316). There is no way to set GPT Image 2.6's complexity.

The upstream facts are in #3781 and were checked 2026-11-09. The 2.6 IDs are gpt-image-2.6-sunburst and gpt-image-2.6-flare. They share the 2.5 token rates, size rules, transparency and masks. Whether they accept the xhigh and max quality tiers is not verified (next paragraph); low, medium and high are documented for every GPT image model. complexity takes low|medium|high, defaults to high and costs nothing extra. The guide's output-token calculator covers 2.6 and 2.5 alike.

Quality tiers on 2.6 (checked 2026-11-10, OpenAI's public docs, no paid request). The sources disagree:

  • The API reference for image generation describes quality: "high, medium and low are supported for the GPT image models", and "gpt-image-2.5-sunburst and gpt-image-2.5-flare, including their 2026-09-08 snapshots, also support xhigh and max." The 2.6 models are in its model list but not in this description.
  • The image generation guide's size and quality section says "gpt-image-2.5-sunburst and gpt-image-2.5-flare add xhigh and max quality settings". Its "Calculating costs" section says "For GPT Image 2.6 and 2.5 Sunburst and Flare, the quality options are low, medium, high, xhigh, and max."
  • The 2.6 Sunburst and 2.6 Flare model pages list no quality tiers.

Only the cost calculator puts xhigh/max on 2.6, and the request reference does not, so this brief treats them as unverified. The max default therefore falls back to the highest tier OpenAI accepts (Scope). high is the highest tier every source documents for 2.6.

Maintainer ruling (2026-11-09): switch to 2.6, and default to the highest quality and highest complexity unless the request says otherwise.

Scope

  • Add gpt-image-2.6-sunburst (the new default) and gpt-image-2.6-flare (by name) with their documented capabilities and token rates. Keep both 2.5 models selectable by --model/preferredModels, after the 2.6 pair in the default order.
  • Add --complexity low|medium|high and validate it before routing, like --quality.
  • On OpenAI, a request without --quality sends quality: "max", and a request without --complexity sends complexity: "high", on generations and edits alike. An explicit value, including --quality auto, is sent as given.
  • Send complexity only to models that document it (the 2.6 pair). An explicit --complexity on a model that does not take it (2.5, Gemini) is refused before any provider call, naming the models that take it.
  • max on 2.6 is unverified (Context), so the default has a fallback. When --quality was not given and OpenAI answers 400 with an error whose param is quality, send the same request again one tier lower, max then xhigh then high, and surface the provider error if high is also refused. This applies to generations and edits and to the 2.5 pair alike. readError (packages/module-images/src/providers/openai.ts:166-211) does not read error.param today and has to. Any other 400, any other status, and an explicit --quality (including max) are never retried with another tier. When a fallback happened, the result's note names the tier used, and the reported cost or estimate uses that tier. Nothing is cached or persisted between invocations.
  • A dry run prices the defaulted quality the same way it prices an explicit one (estimateOpenAiOutputCost), so max and a size or aspect give an estimate.
  • Update brain image --help, the README, the image-gen skill, the changeset, and the retired-model migration message, which should now point at 2.6.
  • Add Epic: image generation runs on GPT Image 2.6 and uses its complexity, GIF, SVG and markup features #3781 to the Modules track in scripts/sync-project.ts.

Out of scope

GIF, SVG and markup output (sibling tasks). Retiring the 2.5 pair. Resolution-bucket validation (#1822, a separate open task touching the same files). Gemini quality settings. Streaming. Re-ranking against the arenas: no 2.6 measurement is encoded, so the default remains a maintainer decision.

Acceptance criteria

  • With an OpenAI key and no pins, routing resolves gpt-image-2.6-sunburst. --model gpt-image-2.6-flare, --model gpt-image-2.5-sunburst and --model gpt-image-2.5-flare each resolve to themselves.
  • Offline fetch stubs show that a generation without --quality/--complexity sends "quality":"max" and "complexity":"high" to the 2.6 models. The multipart edit carries the same fields. An explicit --quality low --complexity medium is sent unchanged.
  • A 2.5 model receives quality: "max" by default but never a complexity field. --complexity with a 2.5 or Gemini model refuses with zero fetch calls. An invalid --complexity value refuses before routing.
  • Quality fallback: with --quality absent, an offline stub that answers 400 {"error":{"param":"quality",...}} to max makes the provider resend with xhigh, then high. The stubbed JSON and multipart bodies show that order, at most three fetch calls happen, and the result's note names the tier used. A 400 on another param, a non-400 error and an explicit --quality max that gets the same 400 each make exactly one fetch call and surface the provider error. Removing the fallback, or letting it apply to an explicit --quality, makes a named test fail.
  • brain image --dry-run --aspect 1:1 on the default route reports a non-null estimate for max quality, computed from the documented calculator.
  • brain image models lists the 2.6 pair first, and the retired-model message names the 2.6 replacements.
  • Help, README, skill and changeset describe the new default, the defaults for quality and complexity, and the cost consequence of defaulting to max.
  • Each behaviour test fails on the current tree for the stated reason, and a restored mutation of the default and the complexity guard shows that the guard is effective.

Verification

bun run test packages/module-images
bun run typecheck
bun run lint
bun run check:pr --base origin/main

Keyless and offline only, with stubbed fetch and no network. No paid request is made.

Contract impact

The --json envelopes are unchanged. brain image CLI flags and its default model are not in the integration contract index (#586 shipped the same kind of change without one). The new flag and defaults are additive behaviour, so this ships as a minor changeset for @schlessera/brain-module-images. The changeset states that the default output now costs more (max quality) and that the default steps down to xhigh or high when OpenAI refuses max for a model.

Updated 2026-11-10: the quality fallback (Scope, Acceptance criteria) was added after #3786 was opened. #3786 does not implement it, so it needs that change and its failing-first and mutation receipts before it merges. "No code changes remain" above no longer holds.

Activity

  1. added this to the 0.45.0 milestone on Nov 9, 2026
  2. added
    type: feat
    area: modules
    priority: p1
    agent-ready
    on Nov 9, 2026
  3. self-assigned this
    on Nov 9, 2026
  4. schlessera commented on Nov 9, 2026

    @schlessera
    OwnerAuthor

    Claimed (claim-3782-31219). Branch: feat/imagegen-gpt-image-2-6. Collision check over the cited module-images sources found closure-level overlap only (shared tests/unit-test-consumers.test.ts, packages/module-images/tests/module.test.ts via #3393/#3458); no open PR edits these sources. #1822 touches the same files and stays separate.

  5. schlessera commented on Nov 9, 2026

    @schlessera
    OwnerAuthor

    Status (2026-11-09): implementation complete in #3786, merge paused.

    To resume: merge current main into the branch (no conflicts are expected outside packages/module-images), push, then run bun scripts/integrate.ts confirm 3786 --issues schlessera/brain-kit#3782. No code changes remain.

    Releasing my assignment so the PR can be landed by whoever resumes.

  6. removed their assignment
    on Nov 9, 2026
  7. schlessera commented on Nov 10, 2026

    @schlessera
    OwnerAuthor

    2026-11-10 triage at main d79eeed0a: I checked again whether GPT Image 2.6 accepts xhigh and max, using OpenAI's public docs and no paid request. It is still not confirmed. The API reference's quality description names only the 2.5 pair for xhigh/max, and the guide's size and quality section does too. Both 2.6 model pages list no tiers. One new data point: the guide's "Calculating costs" section says "For GPT Image 2.6 and 2.5 Sunburst and Flare, the quality options are low, medium, high, xhigh, and max." The sources still disagree. Quotes and links are now in Context.

    So that this is safe to build now, I made these changes to the brief. They follow the 2026-11-09 ruling (highest quality unless the request says otherwise) without depending on the unverified tier:

    • Context no longer says 2.6 shares the low..max tiers.
    • Scope: when quality was defaulted and OpenAI refuses it with a 400 whose param is quality, the request steps down max → xhigh → high. An explicit --quality is never changed. The result's note names the tier used.
    • One new acceptance criterion covers the fallback, the cases that must not retry, and the mutation. The changeset line now mentions the step-down.
    • Open PR feat(module-images): default to GPT Image 2.6 at max quality and high complexity #3786 predates this criterion. It needs the fallback, plus failing-first and mutation receipts, before it merges.

    No product ruling is needed. Labels unchanged (agent-ready kept). The #3781 body is not changed, because the result is still "unverified".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyarea: modulespriority: p1type: feat

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions