Skip to content

Commit b64dfcb

Browse files
committed
Update system prompt construction
1 parent 11744b1 commit b64dfcb

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
@@ -103,11 +103,11 @@ export namespace LLM {
103103
system.push(
104104
[
105105
// use agent prompt otherwise provider prompt
106-
...(input.agent.prompt ? [input.agent.prompt] : SystemPrompt.provider(input.model)),
106+
...(input.agent.prompt ? [input.agent.prompt] : (input.user.system ? [input.user.system] : SystemPrompt.provider(input.model))),
107107
// any custom prompt passed into this call
108108
...input.system,
109109
// any custom prompt from last user message
110-
...(input.user.system ? [input.user.system] : []),
110+
...((input.agent.prompt && input.user.system) ? [input.user.system] : []),
111111
]
112112
.filter((x) => x)
113113
.join("\n"),
@@ -131,10 +131,10 @@ export namespace LLM {
131131
const base = input.small
132132
? ProviderTransform.smallOptions(input.model)
133133
: ProviderTransform.options({
134-
model: input.model,
135-
sessionID: input.sessionID,
136-
providerOptions: provider.options,
137-
})
134+
model: input.model,
135+
sessionID: input.sessionID,
136+
providerOptions: provider.options,
137+
})
138138
const options: Record<string, any> = pipe(
139139
base,
140140
mergeDeep(input.model.options),

0 commit comments

Comments
 (0)