Skip to content

Commit 94dd0a8

Browse files
committed
ignore: rm spoof and bump plugin version
1 parent a848435 commit 94dd0a8

File tree

7 files changed

+12
-13
lines changed

7 files changed

+12
-13
lines changed

packages/opencode/src/agent/agent.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { PermissionNext } from "@/permission/next"
1717
import { mergeDeep, pipe, sortBy, values } from "remeda"
1818
import { Global } from "@/global"
1919
import path from "path"
20+
import { Plugin } from "@/plugin"
2021

2122
export namespace Agent {
2223
export const Info = z
@@ -279,8 +280,8 @@ export namespace Agent {
279280
const model = await Provider.getModel(defaultModel.providerID, defaultModel.modelID)
280281
const language = await Provider.getLanguage(model)
281282

282-
const system = SystemPrompt.header(defaultModel.providerID)
283-
system.push(PROMPT_GENERATE)
283+
const system = [PROMPT_GENERATE]
284+
await Plugin.trigger("experimental.chat.system.transform", { model }, { system })
284285
const existing = await list()
285286

286287
const params = {

packages/opencode/src/global/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ await Promise.all([
3333
fs.mkdir(Global.Path.bin, { recursive: true }),
3434
])
3535

36-
const CACHE_VERSION = "18"
36+
const CACHE_VERSION = "19"
3737

3838
const version = await Bun.file(path.join(Global.Path.cache, "version"))
3939
.text()

packages/opencode/src/plugin/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { CopilotAuthPlugin } from "./copilot"
1515
export namespace Plugin {
1616
const log = Log.create({ service: "plugin" })
1717

18-
const BUILTIN = ["[email protected].9", "@gitlab/[email protected]"]
18+
const BUILTIN = ["[email protected].10", "@gitlab/[email protected]"]
1919

2020
// Built-in plugins that are directly imported (not installed from npm)
2121
const INTERNAL_PLUGINS: PluginInstance[] = [CodexAuthPlugin, CopilotAuthPlugin]

packages/opencode/src/session/llm.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export namespace LLM {
6666
])
6767
const isCodex = provider.id === "openai" && auth?.type === "oauth"
6868

69-
const system = SystemPrompt.header(input.model.providerID)
69+
const system = []
7070
system.push(
7171
[
7272
// use agent prompt otherwise provider prompt
@@ -83,7 +83,11 @@ export namespace LLM {
8383

8484
const header = system[0]
8585
const original = clone(system)
86-
await Plugin.trigger("experimental.chat.system.transform", { sessionID: input.sessionID }, { system })
86+
await Plugin.trigger(
87+
"experimental.chat.system.transform",
88+
{ sessionID: input.sessionID, model: input.model },
89+
{ system },
90+
)
8791
if (system.length === 0) {
8892
system.push(...original)
8993
}

packages/opencode/src/session/prompt/anthropic_spoof.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

packages/opencode/src/session/system.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ async function resolveRelativeInstruction(instruction: string): Promise<string[]
3434
}
3535

3636
export namespace SystemPrompt {
37-
export function header(providerID: string) {
38-
if (providerID.includes("anthropic")) return [PROMPT_ANTHROPIC_SPOOF.trim()]
39-
return []
40-
}
41-
4237
export function instructions() {
4338
return PROMPT_CODEX.trim()
4439
}

packages/plugin/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export interface Hooks {
203203
},
204204
) => Promise<void>
205205
"experimental.chat.system.transform"?: (
206-
input: { sessionID: string },
206+
input: { sessionID?: string; model: Model },
207207
output: {
208208
system: string[]
209209
},

0 commit comments

Comments
 (0)