Skip to content

Commit 562aca5

Browse files
committed
Update system prompt construction
1 parent 6a7d9c6 commit 562aca5

File tree

1 file changed

+6
-6
lines changed
  • packages/opencode/src/session

1 file changed

+6
-6
lines changed

packages/opencode/src/session/llm.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ export namespace LLM {
9292
system.push(
9393
[
9494
// use agent prompt otherwise provider prompt
95-
...(input.agent.prompt ? [input.agent.prompt] : SystemPrompt.provider(input.model)),
95+
...(input.agent.prompt ? [input.agent.prompt] : (input.user.system && input.agent.name !== "title" ? [input.user.system] : SystemPrompt.provider(input.model))),
9696
// any custom prompt passed into this call
9797
...input.system,
9898
// any custom prompt from last user message
99-
...(input.user.system ? [input.user.system] : []),
99+
...((input.agent.prompt && input.user.system) ? [input.user.system] : []),
100100
]
101101
.filter((x) => x)
102102
.join("\n"),
@@ -120,10 +120,10 @@ export namespace LLM {
120120
const base = input.small
121121
? ProviderTransform.smallOptions(input.model)
122122
: ProviderTransform.options({
123-
model: input.model,
124-
sessionID: input.sessionID,
125-
providerOptions: provider.options,
126-
})
123+
model: input.model,
124+
sessionID: input.sessionID,
125+
providerOptions: provider.options,
126+
})
127127
const options: Record<string, any> = pipe(
128128
base,
129129
mergeDeep(input.model.options),

0 commit comments

Comments
 (0)