From 521fba8ce39ac45db0d82905de92adbf4a08452a Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Sun, 14 Dec 2025 16:55:03 -0500 Subject: [PATCH] tweaks --- packages/opencode/src/session/llm.ts | 24 +++++++++++++----------- packages/opencode/src/tool/bash.ts | 27 --------------------------- 2 files changed, 13 insertions(+), 38 deletions(-) diff --git a/packages/opencode/src/session/llm.ts b/packages/opencode/src/session/llm.ts index 781ff83848..97b8aae2bd 100644 --- a/packages/opencode/src/session/llm.ts +++ b/packages/opencode/src/session/llm.ts @@ -46,17 +46,19 @@ export namespace LLM { }) const [language, cfg] = await Promise.all([Provider.getLanguage(input.model), Config.get()]) - const [first, ...rest] = [ - // header prompt for providers with auth checks - ...SystemPrompt.header(input.model.providerID), - // use agent prompt otherwise provider prompt - ...(input.agent.prompt ? [input.agent.prompt] : SystemPrompt.provider(input.model)), - // any custom prompt passed into this call - ...input.system, - // any custom prompt from last user message - ...(input.user.system ? [input.user.system] : []), - ] - const system = [first, rest.join("\n")].filter((x) => x) + const system = SystemPrompt.header(input.model.providerID) + system.push( + [ + // use agent prompt otherwise provider prompt + ...(input.agent.prompt ? [input.agent.prompt] : SystemPrompt.provider(input.model)), + // any custom prompt passed into this call + ...input.system, + // any custom prompt from last user message + ...(input.user.system ? [input.user.system] : []), + ] + .filter((x) => x) + .join("\n"), + ) const params = await Plugin.trigger( "chat.params", diff --git a/packages/opencode/src/tool/bash.ts b/packages/opencode/src/tool/bash.ts index ff18e15e39..115d8f8b29 100644 --- a/packages/opencode/src/tool/bash.ts +++ b/packages/opencode/src/tool/bash.ts @@ -49,33 +49,6 @@ const parser = lazy(async () => { return p }) -const getShell = lazy(() => { - const s = process.env.SHELL - if (s) { - const basename = path.basename(s) - if (!new Set(["fish", "nu"]).has(basename)) { - return s - } - } - - if (process.platform === "darwin") { - return "/bin/zsh" - } - - if (process.platform === "win32") { - // Let Bun / Node pick COMSPEC (usually cmd.exe) - // or explicitly: - return process.env.COMSPEC || true - } - - const bash = Bun.which("bash") - if (bash) { - return bash - } - - return true -}) - // TODO: we may wanna rename this tool so it works better on other shells export const BashTool = Tool.define("bash", async () => { const shell = Shell.acceptable()