Skip to content

[BUG] Image paste fails only on Azure GPT-5.2-Codex (File not found / [Image 1] not processed) #9375

Closed

Description

@InCerryGit

Description

Description

When using Azure GPT-5.2-Codex (gpt-5.2-codex on Azure) in OpenCode, pasting an image from the clipboard fails.

Image

After I paste an image (e.g., screenshot → Ctrl+V), the TUI inserts a placeholder like:

[Image 1]

But when I send the message, OpenCode attempts to read a local file named Image 1 and fails with an error similar to:

Error: File not found: ...\Image 1

As a result, the image is not processed/recognized.

This issue happens only with Azure GPT-5.2-Codex. If I switch to GPT-5.2 (non-codex), everything works normally and the pasted image is processed correctly.

Suspected cause: This looks like a model/API integration issue specific to Azure GPT-5.2-Codex, where the image/file part is not being sent/handled correctly and only the [Image 1] placeholder text remains, causing downstream logic to treat it as a local filename.

Steps to reproduce

  1. Start OpenCode and select Azure GPT-5.2-Codex.
  2. Copy an image to clipboard (e.g., take a screenshot).
  3. Paste into OpenCode input (Ctrl+V) → [Image 1] appears.
  4. Send the prompt.
  5. Observe OpenCode tries to read Image 1 as a local file and fails with File not found.
  6. Switch to GPT-5.2 (non-codex) and repeat → works as expected.

Expected behavior

Pasted clipboard images should be transmitted to the model and processed normally (image recognition works).

Actual behavior

Only the [Image 1] placeholder is present at send time; OpenCode tries to read a local file named Image 1 and errors with File not found.

Screenshot / Logs

(Attach screenshot here showing the “Read Image 1” + “File not found: ...\Image 1” error.)

Environment

  • OpenCode version:
  • OS:
  • Azure model: gpt-5.2-codex
  • Terminal:
  • Plugins: <fill in / none>

Plugins

no

OpenCode version

1.1.25

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Powershell

Activity

  1. github-actions commented on Jan 19, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  2. chiangleoi commented on Jan 20, 2026

    @chiangleoi

    @InCerryGit 请问,opencode 如何链接 azure gpt5.2-codex ? 我选择这个模型的时候只让我填写了 key,没有配置 endpoint 等信息的地方

  3. InCerryGit commented on Jan 20, 2026

    @InCerryGit
    Author

    @InCerryGit 请问,opencode 如何链接 azure gpt5.2-codex ? 我选择这个模型的时候只让我填写了 key,没有配置 endpoint 等信息的地方

    文档中写了,配置环境变量即可 https://opencode.ai/docs/providers/#azure-openai

  4. Ihab-Zhaika commented on Jan 25, 2026

    @Ihab-Zhaika

    Having same issue

    Image Image
  5. Ihab-Zhaika commented on Jan 25, 2026

    @Ihab-Zhaika

    @InCerryGit try this [in provider]

    "azure": {
      "models": {
        "gpt-5.2-codex": {
          "name": "GPT-5.2 Codex",
          "limit": { "context": 400000, "output": 128000 },
          "modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
           "variants": {
            "low": { "reasoningEffort": "low" },
            "medium": { "reasoningEffort": "medium" },
            "high": { "reasoningEffort": "high" },
            "xhigh": { "reasoningEffort": "xhigh" }
          },
    	  "supportsVision": true,
    	  "useResponsesAPI": true
        }
      }
    }
    

    the thing that solved it is
    "supportsVision": true,
    "useResponsesAPI": true

    you can add PR to support it in the code

  6. github-actions commented on Mar 27, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingwindows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions