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): allow integer GPT versions in Codex model filter (#47384) · koji/opencode@500c46e

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
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ 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+)/)
300+
const match = model.api.id.match(/^gpt-(\d+(?:\.\d+)?)/)
301301
return match ? parseFloat(match[1]) > 5.4 : false
302302
})
303303
.map(([modelID, model]) => [
Collapse file

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

Copy file name to clipboardExpand all lines: packages/opencode/test/plugin/codex.test.ts
+23Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,29 @@ describe("plugin.codex", () => {
326326
)
327327
})
328328

329+
test.each([
330+
["gpt-6-astra", true],
331+
["gpt-6", true],
332+
["gpt-6.0-astra", true],
333+
["gpt-7", true],
334+
["gpt-5", false],
335+
["gpt-4.1", false],
336+
["gpt-5.5-pro", false],
337+
["gpt-5.6", false],
338+
["not-a-gpt-model", false],
339+
])("filters OAuth model %s with integer or decimal versions", async (id, allowed) => {
340+
const hooks = await CodexAuthPlugin({} as never)
341+
const provider = {
342+
models: {
343+
[id]: { id, api: { id }, limit: {}, cost: {}, options: {} },
344+
},
345+
}
346+
347+
const models = await hooks.provider!.models!(provider as never, { auth: { type: "oauth" } } as never)
348+
349+
expect(Object.keys(models)).toEqual(allowed ? [id] : [])
350+
})
351+
329352
test("deduplicates concurrent Codex token refreshes", async () => {
330353
const refreshedAccess = createTestJwt({
331354
"https://api.openai.com/auth": { chatgpt_compute_residency: "eu" },

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.