Skip to content

fix(design): drop gpt-image-2 tool model on gpt-4o orchestrator (#1771)#1773

Open
Pablosinyores wants to merge 1 commit into
garrytan:mainfrom
Pablosinyores:fix/1771-design-image-gen-pairing
Open

fix(design): drop gpt-image-2 tool model on gpt-4o orchestrator (#1771)#1773
Pablosinyores wants to merge 1 commit into
garrytan:mainfrom
Pablosinyores:fix/1771-design-image-gen-pairing

Conversation

@Pablosinyores
Copy link
Copy Markdown

Summary

The Responses API rejects pairing a gpt-4o orchestrator with an image_generation tool spec'd as model: "gpt-image-2" with a generic 400 invalid_request_error. gpt-image-2 is only valid under a gpt-5 orchestrator; with gpt-4o the tool must omit the model field (defaults to gpt-image-1).

This regression landed in v1.43.2.0 (commit 66f3a180, 2026-05-21), which added model: "gpt-image-2" to the tool spec while leaving the orchestrator at gpt-4o. The pairing took all five design subcommands offline:

  • design generate
  • design variants
  • design iterate
  • design evolve
  • /design-shotgun

Closes #1771.

Fix

Revert the five call sites to the pre-regression shape (drop the tool model field; the API defaults to gpt-image-1 which works under gpt-4o):

  • design/src/generate.ts:53
  • design/src/variants.ts:73
  • design/src/iterate.ts:98 (threaded fresh-prompt call)
  • design/src/iterate.ts:145 (threaded follow-up call)
  • design/src/evolve.ts:67

Regression tripwire

design/test/image-gen-pairing.test.ts is a static-grep tripwire over every design/src/*.ts. It fails CI if any module contains BOTH the literal model: "gpt-4o" and the literal model: "gpt-image-2" — the unsupported pairing.

Same shape as existing tripwires in browse/test/:

  • cdp-session-cleanup.test.ts
  • terminal-agent-pid-identity.test.ts
  • server-embedder-terminal-port.test.ts

To re-enable gpt-image-2 later, the orchestrator must also be bumped off gpt-4o in the SAME diff — the tripwire allows that because both literals are no longer co-present in one module.

Validation

$ bun test design/test/image-gen-pairing.test.ts
 19 pass
 0 fail
 19 expect() calls
Ran 19 tests across 1 file. [18.00ms]

$ bun test design/test/image-gen-pairing.test.ts design/test/variants-retry-after.test.ts design/test/auth.test.ts design/test/daemon.test.ts design/test/serve.test.ts design/test/gallery.test.ts
 87 pass
 0 fail
 267 expect() calls
Ran 87 tests across 6 files. [7.99s]

design/test/feedback-roundtrip*.test.ts were not run locally — they require a Playwright Chromium install which isn't on this machine. They don't touch the orchestrator/tool model literals, so the fix is orthogonal to that path.

AI assistance disclosure

Patch was drafted with AI assistance. Diff was hand-reviewed against the regression commit 66f3a180; root cause cross-referenced with the issue body (paired with the maintainer's own correction note); tripwire test inverts the failing condition described in the issue and reproduces the failure when reverted (verified locally when generate.ts was initially missed).

…ytan#1771)

The Responses API rejects a gpt-4o orchestrator paired with an
`image_generation` tool spec'd as `model: "gpt-image-2"` (400
invalid_request_error). `gpt-image-2` is only valid under a gpt-5
orchestrator; with gpt-4o the tool must omit the `model` field
(defaults to `gpt-image-1`).

This regression landed in v1.43.2.0 (commit 66f3a18, 2026-05-21),
which added `model: "gpt-image-2"` to the `image_generation` tool
spec while leaving the top-level orchestrator at `gpt-4o`. The
pairing took all five `design` subcommands offline with a generic
400 error: `/design-shotgun`, `design variants`, `design generate`,
`design iterate`, and `design evolve`.

Revert the four call sites to the pre-regression shape (drop the
`model` field, fall back to the API default `gpt-image-1`):

- design/src/generate.ts:53
- design/src/variants.ts:73
- design/src/iterate.ts:98 (threaded fresh-prompt call)
- design/src/iterate.ts:145 (threaded follow-up call)
- design/src/evolve.ts:67

Add a static-grep tripwire (`design/test/image-gen-pairing.test.ts`)
that scans every `design/src/*.ts` and fails CI if any module
contains both the literal `model: "gpt-4o"` and the literal
`model: "gpt-image-2"`. The check follows the same shape as the
existing tripwires in browse/test/ (cdp-session-cleanup,
terminal-agent-pid-identity, server-embedder-terminal-port) — single
forbidden source-level pattern, clear remediation in the failure
message. To re-enable gpt-image-2 the orchestrator must also be
bumped off gpt-4o in the same diff; the tripwire allows that because
both literals are no longer present in the same module.

Closes garrytan#1771.
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.

design image generation broken: gpt-4o orchestrator + gpt-image-2 tool is an unsupported pairing (400)

1 participant