Skip to content

Add under-development original-resolution view_image support#13050

Merged
fjord-oai merged 1 commit intomainfrom
fjord/original_image_res---4hw7wu3447irye
Mar 3, 2026
Merged

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

Conversation

@fjord-oai
Copy link
Copy Markdown
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 5 times, most recently from d76212d to 5a9d457 Compare February 27, 2026 22:44
@fjord-oai fjord-oai force-pushed the fjord/original_image_res---4hw7wu3447irye branch 2 times, most recently from d4d8af6 to 36df309 Compare March 3, 2026 05:57
@fjord-oai
Copy link
Copy Markdown
Contributor Author

@codex review

Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 36df3090c3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@fjord-oai fjord-oai force-pushed the fjord/original_image_res---4hw7wu3447irye branch 2 times, most recently from 22db189 to 4a379cf Compare March 3, 2026 16:30
@fjord-oai fjord-oai force-pushed the fjord/original_image_res---4hw7wu3447irye branch 3 times, most recently from a63c1f8 to 7ca1b75 Compare March 3, 2026 20:50
@fjord-oai fjord-oai force-pushed the fjord/original_image_res---4hw7wu3447irye branch 6 times, most recently from a11ea96 to 2be02bb Compare March 3, 2026 23:07
git-stack-id: fjord/original_image_res---4hw7wu3447irye
git-stack-title: Add under-development original-resolution view_image support
@fjord-oai fjord-oai force-pushed the fjord/original_image_res---4hw7wu3447irye branch from 2be02bb to 2a3bc40 Compare March 3, 2026 23:24
@fjord-oai fjord-oai merged commit b92146d into main Mar 3, 2026
75 of 84 checks passed
@fjord-oai fjord-oai deleted the fjord/original_image_res---4hw7wu3447irye branch March 3, 2026 23:56
@github-actions github-actions bot locked and limited conversation to collaborators Mar 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants