feat(image_gen): add per-call Codex output controls - #14819
lumenradley wants to merge 1 commit into
Conversation
89300b2 to
17b2cef
Compare
|
Update:
Targeted verification after the update: Note on the red CI |
|
Thanks for the careful work here, @lumenradley — the validation logic (gpt-image-2 pixel/aspect/multiple-of-16 bounds, scoped Pydantic warning suppression, PNG-rejects-compression) is well done and the tests are thorough. Unfortunately we can't land this as-is: exposing Closing for that reason rather than any issue with the implementation. If you want to revisit this as a Codex-only path that doesn't touch the global schema (e.g. via env var / config.yaml overrides resolved inside the openai-codex plugin only), that would be mergeable. Sorry for the wasted cycles, and thanks again for the contribution. |
What does this PR do?
Adds per-call output controls for the bundled
openai-codeximage generation backend. This lets callers keepopenai-codexselected globally while overriding safe output options for a single generation:quality:auto,low,medium,highsize:autoor a validated customWIDTHxHEIGHTforgpt-image-2output_format:png,jpeg,webpoutput_compression:0-100forjpeg/webpThe provider keeps unsafe or currently-unhelpful knobs fixed:
background: remainsopaquebecausegpt-image-2does not support transparent backgroundspartial_images: remains0to avoid extra image output token cost when Hermes is not surfacing previewsgpt-image-2)The default Codex image tier is now
gpt-image-2-auto, matching OpenAI's provider-selected quality behavior while still allowing explicitlow/medium/highoverrides.Related Issue
Follow-up to #14317. No separate issue found for per-call
openai-codexoutput controls.Type of Change
Changes Made
tools/image_generation_tool.pyquality,size,output_format, andoutput_compressionarguments in theimage_generateschema.plugins/image_gen/openai-codex/__init__.pygpt-image-2-autoas the default selectable tier.gpt-image-2sizes against OpenAI constraints.partial_images=0to avoid extra preview-token cost.How to Test
image_generatewith overrides such as:quality="high"size="1152x2496"output_format="webp"output_compression=85scripts/run_tests.sh tests/hermes_cli/test_image_gen_picker.py tests/tools/test_image_generation*.py tests/plugins/image_gen/ -qChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AFor New Skills
N/A — this PR does not add a skill.
Screenshots / Logs
Targeted test suite:
Full test suite was attempted using the canonical runner with a clean temporary
HERMES_HOME:Result in this local macOS environment:
The failures appear unrelated to this PR (provider switching, WSL/systemd service tests, file write-deny temp paths, transcription local-command detection, process cleanup timing, etc.). The image generation tests touched by this PR pass.