diff options
| author | Dax Raad <[email protected]> | 2026-02-05 13:23:48 -0500 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2026-02-05 13:23:58 -0500 |
| commit | 47f00d23b3f1e4ba118b5cfe186b329c4a729d92 (patch) | |
| tree | 19cd956ba870cbe900b5ed60202c15b4b8aea495 | |
| parent | 40ebc34909fdb45a0cce5f73725f52ae5dcf8509 (diff) | |
| download | opencode-47f00d23b3f1e4ba118b5cfe186b329c4a729d92.tar.gz opencode-47f00d23b3f1e4ba118b5cfe186b329c4a729d92.zip | |
enable 5.3 codex
| -rw-r--r-- | packages/opencode/src/plugin/codex.ts | 1 | ||||
| -rw-r--r-- | packages/opencode/src/plugin/index.ts | 27 |
2 files changed, 27 insertions, 1 deletions
diff --git a/packages/opencode/src/plugin/codex.ts b/packages/opencode/src/plugin/codex.ts index b6f1a96a9..7658ad55e 100644 --- a/packages/opencode/src/plugin/codex.ts +++ b/packages/opencode/src/plugin/codex.ts @@ -361,6 +361,7 @@ export async function CodexAuthPlugin(input: PluginInput): Promise<Hooks> { "gpt-5.1-codex-mini", "gpt-5.2", "gpt-5.2-codex", + "gpt-5.3-codex", "gpt-5.1-codex", ]) for (const modelId of Object.keys(provider.models)) { diff --git a/packages/opencode/src/plugin/index.ts b/packages/opencode/src/plugin/index.ts index 627c6f8cf..7c55970cd 100644 --- a/packages/opencode/src/plugin/index.ts +++ b/packages/opencode/src/plugin/index.ts @@ -6,13 +6,18 @@ import { createOpencodeClient } from "@opencode-ai/sdk" import { Server } from "../server/server" import { BunProc } from "../bun" import { Instance } from "../project/instance" +import { Flag } from "../flag/flag" import { CodexAuthPlugin } from "./codex" +import { Session } from "../session" +import { NamedError } from "@opencode-ai/util/error" import { CopilotAuthPlugin } from "./copilot" import { gitlabAuthPlugin as GitlabAuthPlugin } from "@gitlab/opencode-gitlab-auth" export namespace Plugin { const log = Log.create({ service: "plugin" }) + const BUILTIN = ["[email protected]"] + // Built-in plugins that are directly imported (not installed from npm) const INTERNAL_PLUGINS: PluginInstance[] = [CodexAuthPlugin, CopilotAuthPlugin, GitlabAuthPlugin] @@ -41,6 +46,9 @@ export namespace Plugin { const plugins = [...(config.plugin ?? [])] if (plugins.length) await Config.waitForDependencies() + if (!Flag.OPENCODE_DISABLE_DEFAULT_PLUGINS) { + plugins.push(...BUILTIN) + } for (let plugin of plugins) { // ignore old codex plugin since it is supported first party now @@ -50,7 +58,24 @@ export namespace Plugin { const lastAtIndex = plugin.lastIndexOf("@") const pkg = lastAtIndex > 0 ? plugin.substring(0, lastAtIndex) : plugin const version = lastAtIndex > 0 ? plugin.substring(lastAtIndex + 1) : "latest" - plugin = await BunProc.install(pkg, version) + const builtin = BUILTIN.some((x) => x.startsWith(pkg + "@")) + plugin = await BunProc.install(pkg, version).catch((err) => { + if (!builtin) throw err + + const message = err instanceof Error ? err.message : String(err) + log.error("failed to install builtin plugin", { + pkg, + version, + error: message, + }) + Bus.publish(Session.Event.Error, { + error: new NamedError.Unknown({ + message: `Failed to install built-in plugin ${pkg}@${version}: ${message}`, + }).toObject(), + }) + + return "" + }) if (!plugin) continue } const mod = await import(plugin) |
