Skip to content

Add under-development original-resolution view_image support#13050

Open
fjord-oai wants to merge 1 commit intomainfrom
fjord/original_image_res---4hw7wu3447irye
Open

Add under-development original-resolution view_image support#13050
fjord-oai wants to merge 1 commit intomainfrom
fjord/original_image_res---4hw7wu3447irye

Conversation

@fjord-oai
Copy link
Contributor

@fjord-oai fjord-oai commented Feb 27, 2026

Summary

Add original-resolution support for view_image behind the under-development view_image_original_resolution feature flag.

When the flag is enabled and the target model is gpt-5.3-codex or newer, view_image now preserves original PNG/JPEG/WebP bytes and sends detail: "original" to the Responses API instead of using the legacy resize/compress path.

What changed

  • Added view_image_original_resolution as an under-development feature flag.
  • Added ImageDetail to the protocol models and support for serializing detail: "original" on tool-returned images.
  • Added PromptImageMode::Original to codex-utils-image.
    • Preserves original PNG/JPEG/WebP bytes.
    • Keeps legacy behavior for the resize path.
  • Updated view_image to:
    • use the shared local_image_content_items_with_label_number(...) helper in both code paths
    • select original-resolution mode only when:
      • the feature flag is enabled, and
      • the model slug parses as gpt-5.3-codex or newer
  • Kept local user image attachments on the existing resize path; this change is specific to view_image.
  • Updated history/image accounting so only detail: "original" images use the docs-based GPT-5 image cost calculation; legacy images still use the old fixed estimate.
  • Added JS REPL guidance, gated on the same feature flag, to prefer JPEG at 85% quality unless lossless is required, while still allowing other formats when explicitly requested.
  • Updated tests and helper code that construct FunctionCallOutputContentItem::InputImage to carry the new detail field.

Behavior

Feature off

  • view_image keeps the existing resize/re-encode behavior.
  • History estimation keeps the existing fixed-cost heuristic.

Feature on + gpt-5.3-codex+

  • view_image sends original-resolution images with detail: "original".
  • PNG/JPEG/WebP source bytes are preserved when possible.
  • History estimation uses the GPT-5 docs-based image-cost calculation for those detail: "original" images.

git stack

@fjord-oai fjord-oai force-pushed the fjord/original_image_res---4hw7wu3447irye branch 2 times, most recently from ab3e4c2 to f884292 Compare February 27, 2026 19:41
@fjord-oai fjord-oai changed the title Add original-resolution view_image support Add under-development original-resolution view_image support Feb 27, 2026
@fjord-oai fjord-oai marked this pull request as ready for review February 27, 2026 20:12
@fjord-oai fjord-oai force-pushed the fjord/original_image_res---4hw7wu3447irye branch 4 times, most recently from 3a2afe9 to d76212d Compare February 27, 2026 22:26
git-stack-id: fjord/original_image_res---4hw7wu3447irye
git-stack-title: Add under-development original-resolution view_image support
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