Skip to content

Commit 47f00d2

Browse files
committed
enable 5.3 codex
1 parent 40ebc34 commit 47f00d2

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

packages/opencode/src/plugin/codex.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ export async function CodexAuthPlugin(input: PluginInput): Promise<Hooks> {
361361
"gpt-5.1-codex-mini",
362362
"gpt-5.2",
363363
"gpt-5.2-codex",
364+
"gpt-5.3-codex",
364365
"gpt-5.1-codex",
365366
])
366367
for (const modelId of Object.keys(provider.models)) {

packages/opencode/src/plugin/index.ts

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@ import { createOpencodeClient } from "@opencode-ai/sdk"
66
import { Server } from "../server/server"
77
import { BunProc } from "../bun"
88
import { Instance } from "../project/instance"
9+
import { Flag } from "../flag/flag"
910
import { CodexAuthPlugin } from "./codex"
11+
import { Session } from "../session"
12+
import { NamedError } from "@opencode-ai/util/error"
1013
import { CopilotAuthPlugin } from "./copilot"
1114
import { gitlabAuthPlugin as GitlabAuthPlugin } from "@gitlab/opencode-gitlab-auth"
1215

1316
export namespace Plugin {
1417
const log = Log.create({ service: "plugin" })
1518

19+
const BUILTIN = ["opencode-anthropic-auth@0.0.13"]
20+
1621
// Built-in plugins that are directly imported (not installed from npm)
1722
const INTERNAL_PLUGINS: PluginInstance[] = [CodexAuthPlugin, CopilotAuthPlugin, GitlabAuthPlugin]
1823

@@ -41,6 +46,9 @@ export namespace Plugin {
4146

4247
const plugins = [...(config.plugin ?? [])]
4348
if (plugins.length) await Config.waitForDependencies()
49+
if (!Flag.OPENCODE_DISABLE_DEFAULT_PLUGINS) {
50+
plugins.push(...BUILTIN)
51+
}
4452

4553
for (let plugin of plugins) {
4654
// ignore old codex plugin since it is supported first party now
@@ -50,7 +58,24 @@ export namespace Plugin {
5058
const lastAtIndex = plugin.lastIndexOf("@")
5159
const pkg = lastAtIndex > 0 ? plugin.substring(0, lastAtIndex) : plugin
5260
const version = lastAtIndex > 0 ? plugin.substring(lastAtIndex + 1) : "latest"
53-
plugin = await BunProc.install(pkg, version)
61+
const builtin = BUILTIN.some((x) => x.startsWith(pkg + "@"))
62+
plugin = await BunProc.install(pkg, version).catch((err) => {
63+
if (!builtin) throw err
64+
65+
const message = err instanceof Error ? err.message : String(err)
66+
log.error("failed to install builtin plugin", {
67+
pkg,
68+
version,
69+
error: message,
70+
})
71+
Bus.publish(Session.Event.Error, {
72+
error: new NamedError.Unknown({
73+
message: `Failed to install built-in plugin ${pkg}@${version}: ${message}`,
74+
}).toObject(),
75+
})
76+
77+
return ""
78+
})
5479
if (!plugin) continue
5580
}
5681
const mod = await import(plugin)

0 commit comments

Comments
 (0)