pull/5462/head
Dax Raad 2025-12-14 16:55:03 -05:00
parent 3d813f03e5
commit 521fba8ce3
2 changed files with 13 additions and 38 deletions

View File

@ -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",

View File

@ -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()