The open source coding agent.
TypeScript
ignore: rm spoof and bump plugin version
Aiden Cline94dd0a8dbebd
diff --git a/packages/opencode/src/agent/agent.ts b/packages/opencode/src/agent/agent.tsindex 2b44308f130..19ac607cebf 100644--- a/packages/opencode/src/agent/agent.ts+++ b/packages/opencode/src/agent/agent.ts@@ -17,6 +17,7 @@ import { PermissionNext } from "@/permission/next"import { mergeDeep, pipe, sortBy, values } from "remeda"import { Global } from "@/global"import path from "path"+import { Plugin } from "@/plugin"export namespace Agent {export const Info = z@@ -279,8 +280,8 @@ export namespace Agent {const model = await Provider.getModel(defaultModel.providerID, defaultModel.modelID)const language = await Provider.getLanguage(model)- const system = SystemPrompt.header(defaultModel.providerID)- system.push(PROMPT_GENERATE)+ const system = [PROMPT_GENERATE]+ await Plugin.trigger("experimental.chat.system.transform", { model }, { system })const existing = await list()const params = {diff --git a/packages/opencode/src/global/index.ts b/packages/opencode/src/global/index.tsindex d3011b41506..ade3e5d5295 100644--- a/packages/opencode/src/global/index.ts+++ b/packages/opencode/src/global/index.ts@@ -33,7 +33,7 @@ await Promise.all([fs.mkdir(Global.Path.bin, { recursive: true }),])-const CACHE_VERSION = "18"+const CACHE_VERSION = "19"const version = await Bun.file(path.join(Global.Path.cache, "version")).text()diff --git a/packages/opencode/src/plugin/index.ts b/packages/opencode/src/plugin/index.tsindex 76d34b845ae..691fff4b2f8 100644--- a/packages/opencode/src/plugin/index.ts+++ b/packages/opencode/src/plugin/index.ts@@ -15,7 +15,7 @@ import { CopilotAuthPlugin } from "./copilot"export namespace Plugin {const log = Log.create({ service: "plugin" })- const BUILTIN = ["[email protected]", "@gitlab/[email protected]"]+ const BUILTIN = ["[email protected]", "@gitlab/[email protected]"]// Built-in plugins that are directly imported (not installed from npm)const INTERNAL_PLUGINS: PluginInstance[] = [CodexAuthPlugin, CopilotAuthPlugin]diff --git a/packages/opencode/src/session/llm.ts b/packages/opencode/src/session/llm.tsindex 55c9c452473..1e409b03fe6 100644--- a/packages/opencode/src/session/llm.ts+++ b/packages/opencode/src/session/llm.ts@@ -66,7 +66,7 @@ export namespace LLM {])const isCodex = provider.id === "openai" && auth?.type === "oauth"- const system = SystemPrompt.header(input.model.providerID)+ const system = []system.push([// use agent prompt otherwise provider prompt@@ -83,7 +83,11 @@ export namespace LLM {const header = system[0]const original = clone(system)- await Plugin.trigger("experimental.chat.system.transform", { sessionID: input.sessionID }, { system })+ await Plugin.trigger(+ "experimental.chat.system.transform",+ { sessionID: input.sessionID, model: input.model },+ { system },+ )if (system.length === 0) {system.push(...original)}diff --git a/packages/opencode/src/session/prompt/anthropic_spoof.txt b/packages/opencode/src/session/prompt/anthropic_spoof.txtdeleted file mode 100644index aed6cc19789..00000000000--- a/packages/opencode/src/session/prompt/anthropic_spoof.txt+++ /dev/null@@ -1 +0,0 @@-You are Claude Code, Anthropic's official CLI for Claude.diff --git a/packages/opencode/src/session/system.ts b/packages/opencode/src/session/system.tsindex 8d619357a4f..b055bd10e70 100644--- a/packages/opencode/src/session/system.ts+++ b/packages/opencode/src/session/system.ts@@ -34,11 +34,6 @@ async function resolveRelativeInstruction(instruction: string): Promise<string[]}export namespace SystemPrompt {- export function header(providerID: string) {- if (providerID.includes("anthropic")) return [PROMPT_ANTHROPIC_SPOOF.trim()]- return []- }-export function instructions() {return PROMPT_CODEX.trim()}diff --git a/packages/plugin/src/index.ts b/packages/plugin/src/index.tsindex d02c8bfe53e..86e7ae93420 100644--- a/packages/plugin/src/index.ts+++ b/packages/plugin/src/index.ts@@ -203,7 +203,7 @@ export interface Hooks {},) => Promise<void>"experimental.chat.system.transform"?: (- input: { sessionID: string },+ input: { sessionID?: string; model: Model },output: {system: string[]},