[Bug] OpenRouter model ID "gpt-5.2-chat-latest" is invalid - should be "gpt-5.2-chat" #8150

Closed
opened 2026-02-16 18:09:16 -05:00 by yindo · 2 comments
Owner

Originally created by @primexiao on GitHub (Jan 31, 2026).

Originally assigned to: @rekram1-node on GitHub.

Bug Description

When selecting "GPT-5.2 Chat" model through OpenRouter provider, opencode uses the model ID openai/gpt-5.2-chat-latest, which results in an error:

openai/gpt-5.2-chat-latest is not a valid model ID

Expected Behavior

The model ID should be openai/gpt-5.2-chat (without the -latest suffix), which is the official model ID on OpenRouter.

Reference: https://openrouter.ai/openai/gpt-5.2-chat

Steps to Reproduce

  1. Configure opencode to use OpenRouter as the provider
  2. Open model selector and choose "GPT-5.2 Chat"
  3. Observe error: openai/gpt-5.2-chat-latest is not a valid model ID

Evidence

The incorrect model ID gpt-5.2-chat-latest is hardcoded in the opencode binary:

$ strings $(which opencode) | grep "gpt-5.2-chat-latest"
"gpt-5.2-chat-latest",
"gpt-5.2-chat-latest",
...

The model selection is also persisted incorrectly in ~/.local/state/opencode/model.json:

{"providerID":"openrouter","modelID":"openai/gpt-5.2-chat-latest"}

Environment

  • opencode version: latest from ~/.opencode/bin/opencode
  • Provider: OpenRouter
  • OS: macOS

Suggested Fix

Update the model ID from gpt-5.2-chat-latest to gpt-5.2-chat in the internal model definitions for OpenRouter provider.

Originally created by @primexiao on GitHub (Jan 31, 2026). Originally assigned to: @rekram1-node on GitHub. ## Bug Description When selecting "GPT-5.2 Chat" model through OpenRouter provider, opencode uses the model ID `openai/gpt-5.2-chat-latest`, which results in an error: > openai/gpt-5.2-chat-latest is not a valid model ID ## Expected Behavior The model ID should be `openai/gpt-5.2-chat` (without the `-latest` suffix), which is the official model ID on OpenRouter. **Reference**: https://openrouter.ai/openai/gpt-5.2-chat ## Steps to Reproduce 1. Configure opencode to use OpenRouter as the provider 2. Open model selector and choose "GPT-5.2 Chat" 3. Observe error: `openai/gpt-5.2-chat-latest is not a valid model ID` ## Evidence The incorrect model ID `gpt-5.2-chat-latest` is hardcoded in the opencode binary: ```bash $ strings $(which opencode) | grep "gpt-5.2-chat-latest" "gpt-5.2-chat-latest", "gpt-5.2-chat-latest", ... ``` The model selection is also persisted incorrectly in `~/.local/state/opencode/model.json`: ```json {"providerID":"openrouter","modelID":"openai/gpt-5.2-chat-latest"} ``` ## Environment - opencode version: latest from `~/.opencode/bin/opencode` - Provider: OpenRouter - OS: macOS ## Suggested Fix Update the model ID from `gpt-5.2-chat-latest` to `gpt-5.2-chat` in the internal model definitions for OpenRouter provider.
yindo closed this issue 2026-02-16 18:09:16 -05:00
Author
Owner

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

This issue is related to OpenRouter provider model configuration. Please also check:

  • #11307: OpenRouter Provider: GPT-5.2-Codex missing xhigh variant (only low/medium/high) — Another OpenRouter provider issue with model variants/configuration

These might be related to a broader OpenRouter model configuration issue. You may want to investigate both together.

@github-actions[bot] commented on GitHub (Jan 31, 2026): This issue is related to OpenRouter provider model configuration. Please also check: - #11307: OpenRouter Provider: GPT-5.2-Codex missing xhigh variant (only low/medium/high) — Another OpenRouter provider issue with model variants/configuration These might be related to a broader OpenRouter model configuration issue. You may want to investigate both together.
Author
Owner
@rekram1-node commented on GitHub (Jan 31, 2026): https://github.com/anomalyco/models.dev/commit/0513b73b1791b63f51b2c746f9e5f8513e5442e4
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8150