hermes - 💡(How to fix) Fix openai-codex image provider should support image_edit via Responses image_generation edit

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

Users who rely on Codex/ChatGPT OAuth for image generation can generate images without a separate OpenAI API key, but cannot use the same provider for image edits.

That leaves a gap:

  • image_generate works through image_gen.provider=openai-codex
  • image_edit may be registered/exposed by toolsets
  • but the selected image provider cannot execute the edit request

For users whose primary image path is Codex OAuth, image editing should not require switching providers or adding another API key.

Fix Action

Fix / Workaround

Local Downstream Patch Shape

A downstream local patch validated this shape in plugins/image_gen/openai-codex/__init__.py:

The patch also handles:

RAW_BUFFERClick to expand / collapse

Feature Description

Hermes has image generation provider plugins, including openai-codex, but the openai-codex image provider does not currently expose an image_edit implementation.

There is already related work in #17034 around registering/exposing image_edit in toolsets, and PR #17060 implements an image_edit tool using FAL. This issue is narrower and provider-specific: the openai-codex image provider should support image editing through the ChatGPT/Codex OAuth Responses API path.

Why this matters

Users who rely on Codex/ChatGPT OAuth for image generation can generate images without a separate OpenAI API key, but cannot use the same provider for image edits.

That leaves a gap:

  • image_generate works through image_gen.provider=openai-codex
  • image_edit may be registered/exposed by toolsets
  • but the selected image provider cannot execute the edit request

For users whose primary image path is Codex OAuth, image editing should not require switching providers or adding another API key.

Proposed Behavior

The openai-codex image provider should implement an edit path that accepts:

  • prompt
  • one or more reference images
  • optional mask image
  • aspect ratio / size defaults consistent with generation
  • configured quality/model defaults

The provider should convert local paths or image URLs into Responses API input_image content blocks and call the Responses image_generation tool in edit mode.

Local Downstream Patch Shape

A downstream local patch validated this shape in plugins/image_gen/openai-codex/__init__.py:

  • Convert local file paths or HTTP(S) URLs into input_image blocks.
  • Convert optional masks into input_image_mask.
  • Stream a Codex Responses request with an image_generation tool configured with:
    • model: gpt-image-2
    • action: edit
    • size
    • quality
    • output_format: png
    • partial_images: 1
  • Extract the final or partial image_generation_call.result base64 payload.
  • Save the edited image under the existing Hermes image cache.

The patch also handles:

  • missing prompt
  • missing reference images
  • missing local files
  • missing Codex OAuth credentials
  • OpenAI SDK / stream errors

Relationship To #17034

#17034 covers making image_edit available to model-facing toolsets once the tool exists. This issue covers provider support for openai-codex specifically.

If maintainers prefer, this can be implemented as part of the larger image_edit work, but the provider-specific behavior is worth tracking separately because FAL-based editing and Codex OAuth-based editing have different auth and request contracts.

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix openai-codex image provider should support image_edit via Responses image_generation edit