Skip to content

GPT codex fails on gitlab pipeline #10281

Closed

Description

@MariaJoao23

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

Activity

  1. github-actions commented on Jan 23, 2026

    @github-actions
    Contributor

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

    • @ai-sdk/azure defaults to completions api instead of responses #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.

  2. CezaryKlus commented on Jan 27, 2026

    @CezaryKlus

    I experience the same behavior when running from VS Code devcontainer

  3. JoaoCP13 commented on Feb 6, 2026

    @JoaoCP13

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

  4. github-actions commented on Apr 8, 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 working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions