GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(opencode): compare Codex GPT versions by major and minor (#47385) · krumpstead/opencode@02a167e

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/opencode
    • src/plugin/openai
      • codex.ts
    • test/plugin
      • codex.test.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/opencode/src/plugin/openai/codex.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/src/plugin/openai/codex.ts
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,11 @@ export async function CodexAuthPlugin(input: PluginInput, options: CodexAuthPlug
297297
if (ALLOWED_MODELS.has(model.api.id)) return true
298298
if (DISALLOWED_MODELS.has(model.api.id)) return false
299299
if (model.api.id === "gpt-5.6") return false
300-
const match = model.api.id.match(/^gpt-(\d+(?:\.\d+)?)/)
301-
return match ? parseFloat(match[1]) > 5.4 : false
300+
const match = model.api.id.match(/^gpt-(\d+)(?:\.(\d+))?/)
301+
if (!match) return false
302+
const major = Number(match[1])
303+
const minor = Number(match[2] ?? 0)
304+
return major > 5 || (major === 5 && minor > 4)
302305
})
303306
.map(([modelID, model]) => [
304307
modelID,
Collapse file

‎packages/opencode/test/plugin/codex.test.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/test/plugin/codex.test.ts
+13-1Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,24 @@ describe("plugin.codex", () => {
331331
["gpt-6", true],
332332
["gpt-6.0-astra", true],
333333
["gpt-7", true],
334+
["gpt-10", true],
335+
["gpt-5.5-astra", true],
336+
["gpt-5.9", true],
337+
["gpt-5.10", true],
338+
["gpt-5.10-astra", true],
339+
["gpt-5.40", true],
334340
["gpt-5", false],
341+
["gpt-5.4-astra", false],
342+
["gpt-5.04-astra", false],
335343
["gpt-4.1", false],
344+
["gpt-4.99", false],
336345
["gpt-5.5-pro", false],
337346
["gpt-5.6", false],
347+
["gpt-6garbage", true],
348+
["gpt-6.", true],
349+
["gpt-6.1.2", true],
338350
["not-a-gpt-model", false],
339-
])("filters OAuth model %s with integer or decimal versions", async (id, allowed) => {
351+
])("filters OAuth model %s by GPT major and minor versions", async (id, allowed) => {
340352
const hooks = await CodexAuthPlugin({} as never)
341353
const provider = {
342354
models: {

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.