GPT codex fails on gitlab pipeline #7374

Open
opened 2026-02-16 18:06:59 -05:00 by yindo · 3 comments
Owner

Originally created by @MariaJoao23 on GitHub (Jan 23, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

I'm trying to use gpt-5.1-codex and it works when I run opencode on my local machine, but when I try to run it on a gitlab ci pipeline with the same configurations (same opencode.jsonc and variables) it always fails with the error The chatCompletion operation does not work with the specified model, gpt-5.1-codex. Please choose different model and try again. You can learn more about which models can be used with each operation here: https://go.microsoft.com/fwlink/?linkid=2197993. I also tried with gpt-5.2-codex but it has the same problem. I tried with opencode versions 1.1.23, 1.1.26 and 1.1.34. This is the opencode.jsonc I am using

{
  "$schema": "https://opencode.ai/config.json",
  "model": "azure/gpt-5.1-codex",
  "provider": {
    "azure": {
      "options": {
        "apiKey": "{env:AZURE_OPENAI_API_KEY}",
        "resourceName": "{env:AZURE_OPENAI_RESOURCE_NAME}",
      },
      "models": {
        "gpt-5.1-codex": {
          "name": "gpt-5.1-codex",
          "id": "{env:AZURE_OPENAI_DEPLOYMENT_NAME}"
        }
      }
    }
  }
}

I also added the useCompletionUrls option to false but didn't make any difference, it always resolve to the chatCompletion.

Can you please help? Thank you in advance

Plugins

No response

OpenCode version

1.1.34

Steps to reproduce

  1. Use opencode.jsonc provided above.
  2. On gitlab CI pipeline add something like:
opencode:
  stage: opencode
  image: node:22-slim 
  before_script:
    - npm install -g opencode-ai
  script:
    - export OPENCODE_CONFIG_DIR="opencode-config"
    - opencode run "prompt"

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

No response

Originally created by @MariaJoao23 on GitHub (Jan 23, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description I'm trying to use gpt-5.1-codex and it works when I run opencode on my local machine, but when I try to run it on a gitlab ci pipeline with the same configurations (same opencode.jsonc and variables) it always fails with the error The chatCompletion operation does not work with the specified model, gpt-5.1-codex. Please choose different model and try again. You can learn more about which models can be used with each operation here: https://go.microsoft.com/fwlink/?linkid=2197993. I also tried with gpt-5.2-codex but it has the same problem. I tried with opencode versions 1.1.23, 1.1.26 and 1.1.34. This is the opencode.jsonc I am using ```bash { "$schema": "https://opencode.ai/config.json", "model": "azure/gpt-5.1-codex", "provider": { "azure": { "options": { "apiKey": "{env:AZURE_OPENAI_API_KEY}", "resourceName": "{env:AZURE_OPENAI_RESOURCE_NAME}", }, "models": { "gpt-5.1-codex": { "name": "gpt-5.1-codex", "id": "{env:AZURE_OPENAI_DEPLOYMENT_NAME}" } } } } } ``` I also added the useCompletionUrls option to false but didn't make any difference, it always resolve to the chatCompletion. Can you please help? Thank you in advance ### Plugins _No response_ ### OpenCode version 1.1.34 ### Steps to reproduce 1. Use opencode.jsonc provided above. 2. On gitlab CI pipeline add something like: ```bash opencode: stage: opencode image: node:22-slim before_script: - npm install -g opencode-ai script: - export OPENCODE_CONFIG_DIR="opencode-config" - opencode run "prompt" ``` ### Screenshot and/or share link _No response_ ### Operating System Windows 11 ### Terminal _No response_
yindo added the bug label 2026-02-16 18:06:59 -05:00
Author
Owner

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

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

  • #9035: @ai-sdk/azure defaults to completions api instead of responses - This issue describes the exact same error message: "The chatCompletion operation does not work with the specified model, gpt-5.2-codex" when using Azure provider with codex models. The root cause is that the Azure provider is routing through chat-completions instead of the responses API that these models require.

Feel free to ignore if your specific case differs from the above.

@github-actions[bot] commented on GitHub (Jan 23, 2026): This issue might be a duplicate of existing issues. Please check: - #9035: @ai-sdk/azure defaults to `completions` api instead of `responses` - This issue describes the exact same error message: "The chatCompletion operation does not work with the specified model, gpt-5.2-codex" when using Azure provider with codex models. The root cause is that the Azure provider is routing through chat-completions instead of the responses API that these models require. Feel free to ignore if your specific case differs from the above.
Author
Owner

@CezaryKlus commented on GitHub (Jan 27, 2026):

I experience the same behavior when running from VS Code devcontainer

@CezaryKlus commented on GitHub (Jan 27, 2026): I experience the same behavior when running from VS Code devcontainer
Author
Owner

@JoaoCP13 commented on GitHub (Feb 6, 2026):

I’m having the same issue. I already tried everything. Is something wrong on the opencode.jsonc configuration?

@JoaoCP13 commented on GitHub (Feb 6, 2026): I’m having the same issue. I already tried everything. Is something wrong on the opencode.jsonc configuration?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7374