Repository navigation
fix(openai): support flexible GPT Image 2 dimensions - #118476
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 3, 2026, 1:27 AM ET / 05:27 UTC. ClawSweeper reviewWhat this changesThis PR lets the OpenAI image plugin preserve valid explicit GPT Image 2 dimensions, retains aspect-ratio-derived presets when no size is specified, and documents the supported direct-API geometry rules. Merge readiness⛔ Blocked until stronger real behavior proof is added - 6 items remain Keep this PR open. The valid flexible-dimension pass-through is in the right provider boundary, but the branch still normalizes invalid flexible sizes into a paid legacy-size request despite its stated preflight-failure outcome, and it lacks real after-fix proof for the multipart image-edit path. The protected Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s image tool first normalizes requested geometry using provider capabilities, then sends the resulting size to the selected provider plugin. The OpenAI plugin dispatches generation as JSON or reference-image edits as multipart requests to the Images API. flowchart LR
A[Image tool request] --> B[Shared geometry normalization]
B --> C[OpenAI plugin]
C --> D{Generate or edit}
D --> E[OpenAI Images API]
E --> F[Image response to agent]
Decision needed
Why: The branch and its tests preserve normalization, while the stated user impact says invalid geometry fails before a paid provider call; choosing rejection changes an established provider compatibility path. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +36, Tests +166, Docs +9. Total +211 across 5 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Make invalid GPT Image 2 geometry intentional and consistent: either retain compatibility normalization and remove the claim that invalid requests fail before provider calls, or add an explicit local validation error with focused upgrade coverage; then attach redacted real-provider evidence for a reference-image edit. Do we have a high-confidence way to reproduce the issue? Yes for the invalid-size discrepancy by source inspection: the branch’s false flexible-validation branch invokes the existing closest-size resolver and its new tests assert a provider request with a normalized size. No independent live execution of the reviewed head was possible in this read-only environment. Is this the best way to solve the issue? Unclear: preserving valid explicit dimensions at the OpenAI provider boundary is the right shape, but the PR must resolve whether invalid dimensions are a compatibility-normalized input or a locally rejected error before it is the best complete fix. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fd10614a482b. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Merged via squash.
|
* fix(openai): support flexible GPT Image 2 dimensions * docs(openai): explain flexible GPT Image 2 dimensions
What Problem This Solves
GPT Image 2 generation and editing snapped valid flexible dimensions to legacy presets, rejected valid large square images, and incorrectly treated unsupported below-minimum pixel counts as valid flexible dimensions.
Why This Change Was Made
The provider enforces the documented GPT Image 2 flexible-size recognition contract: dimensions divisible by 16, maximum edge 3840, aspect ratio at most 3:1, and 655360 through 8294400 total pixels. Valid explicit sizes are preserved. Invalid flexible sizes retain the existing compatibility behavior and normalize to supported presets rather than being rejected. Shared normalization keeps landscape/portrait hints, and public image-tool docs explain the bounds and no-snap behavior.
User Impact
Operators can generate AND edit valid arbitrary sizes including 1024x640, 2304x2304, 2560x2560, and 2880x2880. Unsupported requested dimensions continue to normalize through the established supported-size compatibility path.
Real Authenticated Generation AND Reference-Image Edit
Both genuine packaged product CLI operations ran against the live OpenAI Images API with the exact provider/runtime candidate:
Both requests preserve the explicit 655360-pixel minimum non-square size. Credentials and binary contents are not disclosed. Testbox: https://github.com/openclaw/openclaw/actions/runs/30787071524
Regression Evidence