Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions packages/opencode/src/plugin/codex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,13 @@ export async function CodexAuthPlugin(input: PluginInput): Promise<Hooks> {
if (auth.type !== "oauth") return {}

// Filter models to only allowed Codex models for OAuth
const allowedModels = new Set(["gpt-5.1-codex-max", "gpt-5.1-codex-mini", "gpt-5.2", "gpt-5.2-codex"])
// Allow base models and their variants (e.g., gpt-5.2-codex-low, gpt-5.2-codex-high)
const allowedBaseModels = ["gpt-5.1-codex-max", "gpt-5.1-codex-mini", "gpt-5.2", "gpt-5.2-codex"]
for (const modelId of Object.keys(provider.models)) {
if (!allowedModels.has(modelId)) {
const isAllowed = allowedBaseModels.some(
(base) => modelId === base || modelId.startsWith(base + "-"),
)
if (!isAllowed) {
delete provider.models[modelId]
}
}
Expand Down