Skip to content

Do not attach OpenAI image_generation tool for Codex models #369

Closed

Description

@1jehuang

crates/jcode-base/src/provider/openai.rs (~929-932) unconditionally adds { "type": "image_generation" } in ChatGPT mode; Codex models reject/ignore it and it should be gated.

Credit: originally proposed in PR #148. This repo no longer accepts external PRs, so the problem is tracked here instead.

Activity

  1. added
    from-pr
    on Jun 12, 2026
  2. added
    triage: reproducible
    autonomous: likely
    priority: medium
    on Jun 25, 2026
  3. 1jehuang commented on Jun 25, 2026

    @1jehuang
    OwnerAuthor

    Triage: confirmed in crates/jcode-base/src/provider/openai.rs:929-932 (build_response_request). When is_chatgpt_mode is true the request unconditionally appends {"type":"image_generation"} to the tools array; is_chatgpt_mode is set for all Codex/ChatGPT-backend models (is_chatgpt_mode() at line 731), so Codex models that don't support image generation get the tool attached.

    Fix path: gate the image_generation push behind a model capability check (e.g. only push for models that support it) rather than the broad is_chatgpt_mode flag. Localized, low-risk change with a clear path; minor judgment on which model ids qualify, so autonomous: likely.

  4. 1jehuang commented on Jun 25, 2026

    @1jehuang
    OwnerAuthor

    Fixed in b96dfa47 (pending release). Built and tests pass on Linux. See commit message for the specific change for this issue.

  5. added
    triage: fixed-pending-release
    and removed
    triage: reproducible
    on Jun 25, 2026
  6. 1jehuang commented on Jun 28, 2026

    @1jehuang
    OwnerAuthor

    Released in v0.32.0. Run jcode update to get it.

  7. removed
    triage: fixed-pending-release
    on Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    autonomous: likelyfrom-prpriority: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions