anomalyco / anomalyco/opencode

[BUG]: EU Enterprise OAuth requests fail for all tested GPT models after #42432; Codex CLI succeeds

Open
#43,615 3 comments 0 reactions 1 assignee View on GitHub

@rekram1-node is already working on this.

Since Aug 20, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

Using ChatGPT Enterprise OAuth with EU compute residency, all tested GPT models fail in OpenCode on current dev, including the residency fix from #42432.

The same account and models work in the official Codex CLI.

OpenCode returns:

The requested model snapshot is not available for your project's geography.
If you need regional processing, consider switching to a model that officially supports it.

The OAuth access token contains:

chatgpt_compute_residency: "eu"
chatgpt_data_residency: "eu"

As a diagnostic, I changed OpenCode's request identity headers from their normal values to:

originator: codex_cli_rs
version: <installed Codex CLI version>

With both changes applied, the same requests succeed.

This suggests the issue is not specific to GPT-5.6 or an individual model. There appears to be a remaining difference between OpenCode and the official Codex client's request handling for EU-resident Enterprise accounts after #42432.

Related: #40243, #42432, openai/codex#31967

Plugins

No response

OpenCode version

No response

Steps to reproduce
  1. Use a ChatGPT Enterprise account with EU compute residency.

  2. Authenticate OpenCode using ChatGPT OAuth.

  3. On current dev including #42432, select an OpenAI GPT model.

  4. Send a simple prompt.

  5. Observe the model-snapshot geography error.

  6. Repeat with other GPT models; all tested models fail in the same way.

  7. Verify that the same account/models work in the official Codex CLI.

  8. As a diagnostic, change both OpenCode request identity headers to:

    originator: codex_cli_rs
    version: <installed Codex CLI version>
    
  9. Retry the same request. It succeeds.

Expected behavior

ChatGPT Enterprise OAuth requests with EU compute residency should work in OpenCode when the same account and model work in the official Codex CLI.

Actual behavior

All tested GPT models fail with a model-snapshot geography error.

The requests succeed when both originator and version are changed to match the official Codex CLI.

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.