core-agent-ide/codex-rs/utils
Curtis 'Fjord' Hawthorne b92146d48b
Add under-development original-resolution view_image support (#13050)
## 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](https://github.com/magus/git-stack-cli)
- 👉 `1` https://github.com/openai/codex/pull/13050
-  `2` https://github.com/openai/codex/pull/13331
-  `3` https://github.com/openai/codex/pull/13049
2026-03-03 15:56:54 -08:00
..
absolute-path Avoid AbsolutePathBuf::parent() panic under EMFILE by skipping re-absolutization (#12647) 2026-02-23 21:59:33 -08:00
approval-presets chore: remove codex-core public protocol/shell re-exports (#12432) 2026-02-20 23:45:35 -08:00
cache feat: add support for building with Bazel (#8875) 2026-01-09 11:09:43 -08:00
cargo-bin feat: experimental flags (#10231) 2026-02-02 11:06:50 +00:00
cli chore: remove codex-core public protocol/shell re-exports (#12432) 2026-02-20 23:45:35 -08:00
elapsed feat: split codex-common into smaller utils crates (#11422) 2026-02-11 12:59:24 +00:00
fuzzy-match feat: split codex-common into smaller utils crates (#11422) 2026-02-11 12:59:24 +00:00
git feat: add support for building with Bazel (#8875) 2026-01-09 11:09:43 -08:00
home-dir Validate CODEX_HOME before resolving (#10249) 2026-01-30 15:46:33 -08:00
image Add under-development original-resolution view_image support (#13050) 2026-03-03 15:56:54 -08:00
json-to-toml feat: add support for building with Bazel (#8875) 2026-01-09 11:09:43 -08:00
oss feat: split codex-common into smaller utils crates (#11422) 2026-02-11 12:59:24 +00:00
pty feat: use process group to kill the PTY (#12688) 2026-02-24 16:55:23 +00:00
readiness feat: add support for building with Bazel (#8875) 2026-01-09 11:09:43 -08:00
rustls-provider chore: put crypto provider logic in a shared crate (#11294) 2026-02-10 01:04:31 -08:00
sandbox-summary Use model catalog default for reasoning summary fallback (#12873) 2026-02-26 09:31:13 -08:00
sleep-inhibitor feat(sleep-inhibitor): add Linux and Windows idle-sleep prevention (#11766) 2026-02-24 11:51:44 -08:00
stream-parser feat: adding stream parser (#12666) 2026-02-25 13:27:58 +00:00
string tui: restore visible line numbers for hidden file links (#12870) 2026-02-26 10:29:54 +00:00