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

Open
opened 2026-02-16 18:05:13 -05:00 by yindo · 5 comments
Owner

Originally created by @InCerryGit on GitHub (Jan 19, 2026).

Originally assigned to: @rekram1-node on GitHub.

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

Originally created by @InCerryGit on GitHub (Jan 19, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description ### Description When using **Azure GPT-5.2-Codex** (`gpt-5.2-codex` on Azure) in OpenCode, **pasting an image from the clipboard** fails. <img width="1877" height="650" alt="Image" src="https://github.com/user-attachments/assets/ee4cf50c-f1b6-4fa2-ab51-2f23ef98b6eb" /> 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: <fill in> - OS: <fill in> - Azure model: gpt-5.2-codex - Terminal: <fill in> - 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
yindo added the windowsbug labels 2026-02-16 18:05:13 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 19, 2026):

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

  • #5359: Unable to read images for some models - Reports image reading failures with certain backends/models
  • #4983: AI_APICallError - base64 encoded image pasted - Related to image encoding and transmission issues
  • #4077: In Memory Image can't be Pasted in Opencode After TUI Upgrade - Clipboard image pasting failures
  • #7180: Azure OpenAI need to change completions -> responses - Azure API endpoint changes that may affect Azure GPT models
  • #8423: MCP invalid schema in gpt-5.2-codex - Other issues specific to gpt-5.2-codex model

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

@github-actions[bot] commented on GitHub (Jan 19, 2026): This issue might be a duplicate of existing issues. Please check: - #5359: Unable to read images for some models - Reports image reading failures with certain backends/models - #4983: AI_APICallError - base64 encoded image pasted - Related to image encoding and transmission issues - #4077: In Memory Image can't be Pasted in Opencode After TUI Upgrade - Clipboard image pasting failures - #7180: Azure OpenAI need to change completions -> responses - Azure API endpoint changes that may affect Azure GPT models - #8423: MCP invalid schema in gpt-5.2-codex - Other issues specific to gpt-5.2-codex model Feel free to ignore if none of these address your specific case.
Author
Owner

@chiangleoi commented on GitHub (Jan 20, 2026):

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

@chiangleoi commented on GitHub (Jan 20, 2026): @InCerryGit 请问,opencode 如何链接 azure gpt5.2-codex ? 我选择这个模型的时候只让我填写了 key,没有配置 endpoint 等信息的地方
Author
Owner

@InCerryGit commented on GitHub (Jan 20, 2026):

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

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

@InCerryGit commented on GitHub (Jan 20, 2026): > [@InCerryGit](https://github.com/InCerryGit) 请问,opencode 如何链接 azure gpt5.2-codex ? 我选择这个模型的时候只让我填写了 key,没有配置 endpoint 等信息的地方 文档中写了,配置环境变量即可 https://opencode.ai/docs/providers/#azure-openai
Author
Owner

@Ihab-Zhaika commented on GitHub (Jan 25, 2026):

Having same issue

Image Image
@Ihab-Zhaika commented on GitHub (Jan 25, 2026): Having same issue <img width="1505" height="359" alt="Image" src="https://github.com/user-attachments/assets/0e11db6f-6daa-4512-a8ef-9548c0f8793e" /> <img width="682" height="466" alt="Image" src="https://github.com/user-attachments/assets/fd70e783-e333-4642-a65d-4b301d515c73" />
Author
Owner

@Ihab-Zhaika commented on GitHub (Jan 25, 2026):

@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

@Ihab-Zhaika commented on GitHub (Jan 25, 2026): @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
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6771